Close reconnect gap causing dropped real-time messages

Fixkamo-internal
Ya
25 Aprili 2026, 16:43 UTC
Mwandishi
kamo
Ahadi ya
fdc91d2

Remove `connected` from subscription useEffect deps in TicketChat and ChatBox. Previously, every WebSocket reconnect triggered the effect cleanup which called unsubscribe(), deleted the session from the subscription map, and sent /app/chat/unsubscribe to the backend — disabling the NATS→STOMP bridge. **************** in onConnect found nothing to reattach, and any visitor message or system event (NAME_CHANGED) that arrived in the gap was permanently lost. Removing the dep means onConnect handles reconnects without any teardown. Also fix SupportCountContext to subtract focusedSessionsRef.current.size from both the 60-second poll and the PENDING_COUNT WS handler, so the support badge stays decremented while the agent has a ticket focused (backend still counts it as pending with no mark-viewed API). Add markAsRead useEffect in ChatBox keyed to sessionGuid so the Interaction Center unread count decrements whenever a chat window opens, not only when a new in-session message happens to arrive.

Mabadiliko yote

Je, unaona nini kuhusu usafiri?

Kila moja ya hizi updates ardhi katika nafasi yako ya kazi moja kwa moja. Kuanza bure na kuangalia kukua wiki baada ya wiki.

Kuwa Huru MileleMtazamo wa bei