KamoCRM

Trust backend pendingCount, drop client offsets

Fixkamo-internal
Shipped
26 ஏப்ரல், 2026 அன்று 2:13 AM UTC
Author
kamo
Commit
4d32ce7

Backend pendingCount is now unread-based (counts SUPPORT_TICKET sessions with messages newer than the owner's lastViewed). When the agent opens a ticket, markAsRead → backend broadcast → frontend reflects the new count automatically. Removes the focusedSessionsRef subtraction in fetchCount and the PENDING_COUNT handler — those were compensating for a status-based backend count and now double-decrement, which is why the count rebounded after a browser refresh: focusedSessionsRef resets to empty on mount, so the offset went away. Optimistic decrement on markSessionFocused is kept for snappy UX and is reconciled by the broadcast.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing