Server: expire unanswered rematch offers after 60 seconds#67
Open
testtest126 wants to merge 1 commit into
Open
Server: expire unanswered rematch offers after 60 seconds#67testtest126 wants to merge 1 commit into
testtest126 wants to merge 1 commit into
Conversation
The rematch slot used to live until a player disconnected, declined, queued elsewhere, or closed the sheet — an ignored offer left the requester waiting forever against an idle-but-connected opponent. Each slot now carries an expiry task (60s, injectable for tests like the clock override). On expiry both players get rematch_unavailable: the requester stops waiting and an unanswered offer leaves the opponent's sheet — the app already handles that message, so no client changes are needed. Any other slot teardown cancels the task. Completes the optional-hardening item of #39; the decline action itself landed in #55/#65. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The rematch window only closed on disconnect, explicit decline (#55/#65), queueing elsewhere, or dismissing the sheet. An opponent who stayed connected but simply ignored the offer left the requester on "Waiting for opponent…" indefinitely — the last open item of #39.
Change
RematchSlotcarries an expiry task scheduled when the slot opens at game end; default window 60s, injectable viaGameCoordinator(rematchWindow:)the same way tests already override the clock.rematch_unavailable: the requester stops waiting, and an unanswered offer disappears from the opponent's game-over sheet. The app already handles this message (clearsrematchOfferedByOpponent, blocks further requests), so no client changes are needed.Tests
testRematchOfferExpires(0.8s window): offer relayed, both sides notified on expiry, laterequest_rematchrejected with an error, and both players can queue and be paired normally afterwards. Full server suite 26/26 green; the new test passed 3/3 repeat runs.Closes #39.
🤖 Generated with Claude Code