feat(matchmaking): show queue size and reconnect on silent disconnects - #4761
Conversation
Handle the new queue-size broadcast from the matchmaking lobby (#478): display the pool count in the queue UI, and use the ~3s broadcast cadence as a liveness signal — 15s of silence means the connection died without a close frame, so drop the dead socket and rejoin to avoid ghosting in the queue and starting games short-handed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughThe matchmaking modal now displays the current queue size, handles ChangesMatchmaking queue flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant MatchmakingModal
participant WebSocket
participant MatchmakingServer
MatchmakingModal->>WebSocket: Connect
WebSocket->>MatchmakingServer: Open socket
MatchmakingServer-->>WebSocket: Send queue-size
WebSocket-->>MatchmakingModal: Update queue size
MatchmakingServer-->>WebSocket: Send match-assignment
WebSocket-->>MatchmakingModal: Set game assignment
MatchmakingModal->>WebSocket: Reconnect after 15 seconds of silence
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🔧 Fix failing CI
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Client side of the matchmaking
queue-sizebroadcast (server side ships with infra #478).queue-sizemessage and show "Players in queue: N" above the spinner while searching. It's rendered as a pool size (not a position or ETA), only appears once the first broadcast arrives, and unknown message types are still ignored so future protocol additions stay safe.Watchdog details
joinframe is sent (before that the server legitimately sends nothing); reset by every incoming message of any kind.onclose, onmatch-assignment, at the start ofconnect(), and on modal close. Rejoining is always safe: one account holds one queue slot, newest connection wins.Test plan
tsc --noEmitall pass🤖 Generated with Claude Code