Skip to content

fix: remove Sidebar unread count setInterval HTTP polling - #912

Open
Pratyush-Panda-2006 wants to merge 1 commit into
Shivayan09:mainfrom
Pratyush-Panda-2006:fix/sidebar-polling
Open

fix: remove Sidebar unread count setInterval HTTP polling#912
Pratyush-Panda-2006 wants to merge 1 commit into
Shivayan09:mainfrom
Pratyush-Panda-2006:fix/sidebar-polling

Conversation

@Pratyush-Panda-2006

Copy link
Copy Markdown
Contributor

Fixes #874

Description

This PR removes the periodic setInterval blocks that fire HTTP requests every 10 seconds in Sidebar.tsx to fetch unread badge counts.

Instead of polling the database continuously, count synchronization is now fully event-driven, leveraging:

  1. Real-time WebSockets: Listening to notification:new, conversation_read, conversation:deleted, and conversation:participant_deleted to dynamically update counts.
  2. Custom Browser Events: Using lightweight "notifications:read" and "messages:read" custom events to sync counts immediately when the user reads notifications or messages locally.
  3. Navigation/Pathname Updates: Fetching the latest counts when route transitions occur.

@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

@Pratyush-Panda-2006 is attempting to deploy a commit to the Shivayan's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Shivayan09

Copy link
Copy Markdown
Owner

Code fails CI pipeline workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved level:advanced level3 nsoc26 nsoc26 Issues for projects under Nexus Spring of Code, 2026 quality:clean type:performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(client): redundant 10s HTTP polling for unread counts overloads backend

2 participants