Use shared EmailWebSocketContext for real-time unread badge updates

Fixkamo-internal
Shipped
March 17, 2026 at 9:41 PM UTC
Author
kamo
Commit
04f1763

MailButton was creating a duplicate WebSocket connection via useEmailWebSocket() and optimistically incrementing the unread count. Now uses the shared useEmailWebSocketContext() and re-fetches the actual count from the server on each notification, consistent with how FolderSidebar and MessageBrowser work.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing