fix(presence): prevent stale polling responses from overwriting newer websocket updates (#415)#428
Conversation
|
@itssagarK is attempting to deploy a commit to the ixotic27-8245's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @Ixotic27, This PR fixes the presence synchronization race condition reported in #415. The solution introduces timestamp-based conflict resolution so that delayed polling responses cannot overwrite newer WebSocket updates. This preserves accurate real-time presence while keeping the existing polling fallback mechanism intact. Thank you for reviewing. |
|
🚨 Hey @itssagarK, the CI Pipeline is failing on this PR and it has been marked as 🔍 What failed:
📋 Error Details (first 2):
Please fix the issues before this can be reviewed. Here's how: 1. Run checks locally before pushing: npm run lint # Run ESLint
npm run build # Verify production build passes2. Auto-fix common issues: npm run lint -- --fix # Auto-fix lint errors where possible3. Check the full failure log here: Once you push a fix and the CI passes, the |
What does this PR do?
This PR fixes a race condition in the presence synchronization system where delayed HTTP polling responses could overwrite newer real-time WebSocket updates.
Under certain network conditions, users could briefly appear offline or inactive even after a recent WebSocket presence update had already been received.
Changes Made
Timestamp-Based Presence Tracking
lastUpdatedfield to theLiveSessioninterface.Smart Polling Merge Logic
Conflict Resolution
Offline Protection
Why this matters
Before this fix
After this fix
Testing
Verified:
Related Issue
Fixes #415
Checklist
npm run lintpasses