iachat/app/javascript/dashboard
Rodribm10 6aa328e329 fix(aggressive-alert): hidrata tracker de inatividade no boot
Bug reportado em 2026-04-24: só o banner vermelho status→open
funcionava. 5/15/28min nunca disparavam.

Causa: o tracker só era alimentado via websocket ao vivo
(message.created). Se a msg do cliente chegou ANTES da aba carregar
(ou depois de F5), o tracker ficava vazio, setInterval nunca começava,
thresholds nunca disparavam.

Fix:
- Nova função `hydrateFromConversations(convs)` no tracker. Varre
  conversas em 'open', pega a última msg não-activity, se for de
  Contact registra com timestamp REAL (msg.created_at), não Date.now().
  Isso fecha o gap de tempo: se o cliente falou 7min atrás, o YELLOW
  já dispara na hora.
- AggressiveConversationBanner.vue tem agora `watch: allConversations`
  chamando hydrate toda vez que a lista muda (boot + F5 + navegação).
- parseCreatedAt() suporta Unix seconds + ISO.
- findLastNonActivityMessage() ignora mensagens de sistema.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 08:00:38 -03:00
..
api feat: remove Notificações Automáticas + ajusta assinatura WhatsApp 2026-04-23 15:34:45 -03:00
assets Merge branch 'main' into chore/merge-upstream-4.11.0 2026-02-17 23:05:26 -03:00
components fix(aggressive-alert): hidrata tracker de inatividade no boot 2026-04-24 08:00:38 -03:00
components-next feat: remove Notificações Automáticas + ajusta assinatura WhatsApp 2026-04-23 15:34:45 -03:00
composables feat(captain-memory): wire Contact Memories section into conversation sidebar 2026-04-19 07:30:30 -03:00
constants chore: Improve signup flow, reduce the number of inputs (#13350) 2026-01-22 18:47:42 -08:00
helper fix(aggressive-alert): hidrata tracker de inatividade no boot 2026-04-24 08:00:38 -03:00
i18n feat(aggressive-alert): escalada amarelo/laranja/vermelho + toggles 2026-04-23 20:49:24 -03:00
mixins Chore/merge upstream 4.8.0 (#150) 2025-11-19 16:25:58 -03:00
modules feat: Adiciona a opção "Criar FAQ" no menu de contexto da mensagem, permitindo criar uma resposta com seleção de assistente. 2026-02-28 22:20:43 -03:00
routes feat(aggressive-alert): escalada amarelo/laranja/vermelho + toggles 2026-04-23 20:49:24 -03:00
store feat: remove Notificações Automáticas + ajusta assinatura WhatsApp 2026-04-23 15:34:45 -03:00
stores feat: Voice Channel (#11602) 2025-12-19 12:41:33 -08:00
App.vue feat(dashboard): aggressive alert on conversation reopening 2026-04-23 18:03:26 -03:00
featureFlags.js chore(style): fix rubocop offenses and update typing indicators 2026-02-25 15:06:58 -03:00