fix(client): bind a whole-match concede for pod bot matches - #7936
fix(client): bind a whole-match concede for pod bot matches#7936cuinhellcat wants to merge 5 commits into
Conversation
Fixes phase-rs#7920. A pod bot match installs a bare WasmAdapter, so the menu's Concede was refused as an unbound pod-match concession. The bot-match branch of startMatch now binds the duck-typed MatchConcedeCapability to a plain game-level Concede for the local seat (game player 0, the DRAFT_BOT_AI_SEAT authority): CR 104.3a ends the game as a loss, the game-over screen's existing pod effect settles the match, and "Back to pod" returns to the standings with any next round intact. Not covered: no store-level unit test drives the startMatch bot branch end to end — verified live in a 4-seat bot pod instead (concede settles the match, the next round stays playable). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 24 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds conditional whole-match concession support to ChangesBot Match Concede
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This localized change binds concede behavior only for pod bot matches while preserving plain AI-game behavior, with automated and manual validation provided; no actionable merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant GameMenu
participant WasmAdapter
participant MultiplayerDraftStore
participant GameStore
GameMenu->>WasmAdapter: sendMatchConcede()
WasmAdapter->>MultiplayerDraftStore: invoke bound concession
MultiplayerDraftStore->>GameStore: dispatch Concede for player 0
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Linked Issues checkExplanation The changes address issue ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Deferred by maintainer intake policy — not ignored. This current head ( A maintainer must explicitly take this PR or add a local frontend-review exception before it can receive substantive review. The defer label is a routing marker only, not a verdict on the change. |
|
Maintainer note: approve for review. |
|
Maintainer review is complete for current head |
|
The earlier current-head CI hold is superseded. Frontend type-check on |
|
The failed Frontend check on prior head |
matthewevans
left a comment
There was a problem hiding this comment.
Approved. Current head e188a9020ee282fc7e91a10f27bdf64edb019da9 binds the existing conditional whole-match-concede capability only for pod bot matches; the real launch path dispatches the local-seat game concession, and current required checks are green.
Fixes #7920.
What: In a pod draft, conceding a human-vs-bot match did nothing — the menu's Concede is (correctly) gated on a transport-installed whole-match capability, and the bot-match branch of
startMatchinstalls a bareWasmAdapterwith no such binding (console:[useConcedeHandler] refused unbound draft pod match concession).How:
WasmAdaptergains a conditional, pod-installedMatchConcedeCapability, mirroring the P2P adapters' bound-capability pattern — plain AI games never bind it and keep their engine-dispatch concede path. The bot-match branch ofstartMatchbinds it to a plain game-levelConcedefor the local seat (game player 0, theDRAFT_BOT_AI_SEATauthority): CR 104.3a ends the game as a loss, the game-over screen's existing pod effect settles the match through the same path as a played-out game, and "Back to pod" returns to the standings with any next round intact.useConcedeHandleris untouched; its existing bound/unbound tests still hold.Evidence
WasmAdapterfails thesupportsMatchConcedeguard (revert discriminator: an unconditionalsupportsMatchConcede = trueon the class turns it red — and would wrongly reroute every plain AI game's concede); a bound one runs exactly the bound concession.Known gap: no store-level unit test drives the
startMatchbot branch end to end; that seam is covered by the manual pod test above.Summary by CodeRabbit