Skip to content

Conversation

@marcodejongh
Copy link
Owner

The issue was a race condition where the session-joined message could be
processed before the QueueContext had registered its subscription handler.

Changes:

  • Store initial queue data in a ref when session-joined is received
  • Replay pending initial data to new subscribers when they register
  • Always send initial-queue-data notification (even when empty) to ensure
    the QueueContext can set initialQueueDataReceivedFromPeers flag
  • Clear pending data on disconnect, session end, and connection close

The issue was a race condition where the session-joined message could be
processed before the QueueContext had registered its subscription handler.

Changes:
- Store initial queue data in a ref when session-joined is received
- Replay pending initial data to new subscribers when they register
- Always send initial-queue-data notification (even when empty) to ensure
  the QueueContext can set initialQueueDataReceivedFromPeers flag
- Clear pending data on disconnect, session end, and connection close
@vercel
Copy link

vercel bot commented Dec 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
boardsesh Ready Ready Preview, Comment Dec 21, 2025 11:43am

Added console.log statements to trace the queue sync flow:
- Server: log when queue state is fetched/persisted, and session-joined sent
- Client: log when session-joined is received and initial-queue-data is processed
- Client: log when subscribers register and if pending data is sent

This will help identify where the initial queue sync is failing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants