Repository navigation
feat: the opt-in rematch state, the lobby's auto-rematch flag and its switch (v0.21.0) - #36
Merged
Merged
Conversation
… switch (v0.21.0) Co-Authored-By: Claude & Lothrop (cycle.five@proton.me)
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.
Design
Rematch tuning (workspace spec
docs/superpowers/specs/2026-10-15-rematch-tuning-design.md, owner-approved 2026-10-15; plandocs/superpowers/plans/2026-10-15-rematch-tuning.md, Task 1).On 2026-10-15 in prod, 13 of the 25 cancelled games lived under 60 s. Most were rematches auto-started for a lone player who was leaving. Backend v0.48.0 will:
This PR is the wire contract for that. Every change is additive.
Change (v0.20.0 → v0.21.0)
RematchCountdownState::OptIn { ready, eligible, needed, game_type }(status: "opt_in"). Ids are strings (DisplayFromStr), likeActive.player_ids.LobbyChange::AutoRematchChanged { enabled, changed_by }(change_type: "auto_rematch_changed"), sent inside the existingLobbyDelta.LobbySnapshot.auto_rematch: boolwith#[serde(default = "default_true")], so a snapshot from an older server reads as on.ClientMessage::SetAutoRematch { enabled }(type: "set_auto_rematch"), withrequires_lobby() == true.Compatibility
auto_rematchdefaults to true, andOptInis never produced.OptIncannot reach an old client. Lobbies start with auto-rematch on, and an old client has no switch to turn it off. A stray one falls intorematch-countdown.ts'sdefaultbranch (spec, "Compatibility and release").Tests
There are serde round-trips for:
OptIn, with string ids and theopt_intag;AutoRematchChanged, checked against exact JSON;LobbySnapshot, withauto_rematchabsent (reads as on) and with it present;SetAutoRematch: parse,message_type()andrequires_lobby().cargo testpasses (106 unit tests plus doctests), and clippy andcargo +nightly fmtare clean.Review: there is no automated reviewer on this repo (SDLC step 7). The task was reviewed by an independent reviewer pass against the spec's exact wire names, with no findings.
🤖 Generated with Claude Code
https://claude.ai/code/session_01THikdM3Ru6UrrVU7DMcwBY