- Shipped
- 6 Agosti 2026, 22:56 UTC
- Author
- kamo
- Commit
- 1e3fb4e
Three ways the support badge went stale, all of them silent. ASSIGNED was published on /topic/support/agent/{memberId} and this handler only branched on PENDING_COUNT and NEW_TICKET, so a ticket assigned by round-robin changed the badge for nobody. It now refreshes the count. Deliberately not an auto-open: unlike a new arrival, ASSIGNED also fires on bulk reassignment, and a window per ticket would bury the agent. support.agent.* is core NATS, not JetStream. A notification published while this browser's socket happened to be down is not replayed, it is gone, and reconnect was the only thing that refetched — which never fires for a tab that just sits open, exactly how an agent watching the queue uses this app. Tab focus and a 60s foreground interval now bound how stale the number can get. The optimistic decrement on opening a ticket is gone. It was roughly right when the count was unread-only, but the server-side count now keeps an unassigned or self-assigned ticket on the queue half after it is read, so "opened a ticket" no longer implies "the number drops by one" — guessing left the badge visibly wrong until the next broadcast.