Skip to content

Fix China Done freezing on a hidden deck - #153

Merged
coyotte508 merged 1 commit into
masterfrom
fix/china-done-hidden-deck
Sep 14, 2026
Merged

coyotte508 merged 1 commit into
masterfrom
fix/china-done-hidden-deck

Conversation

@coyotte508

Copy link
Copy Markdown
Member

In a two-player China game, clicking Done after the last player's building turn could freeze the browser before the move reached BGS. The viewer replays its turn buffer with the hidden deck removed; China's market refill kept calling addPowerPlant until two plants appeared, even though the empty deck could never supply them.

Stop the refill when no cards remain. Normal server-side draws are unchanged, and the viewer continues to wait for the authoritative result of the committing move.

Validation:

  • Reproduced the freeze with the supplied state from Eerie-painting-5006, using an external worker timeout.
  • 100 engine tests and 27 viewer tests pass, including regressions for hidden/empty/short decks and the final building turn.
  • Clicked Green 1 and Done in the production viewer bundle at 1400px and 390px: exactly one build and one pass sent; Bureaucracy reached with two real plants drawn and no browser errors.
  • Engine/viewer builds and formatting pass.

The fix must be included when rebuilding and publishing the viewer: its local engine replay is where this game freezes. No live game state was changed or deployment performed.

@coyotte508
coyotte508 merged commit 3e8f55c into master Sep 14, 2026
5 checks passed
@coyotte508
coyotte508 deleted the fix/china-done-hidden-deck branch September 14, 2026 20:45
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.

1 participant