Skip to content

fix(ligretto): preserve game state on resume - #647

Merged
Themezv merged 2 commits into
masterfrom
fix/issue-643-resume-game
Aug 16, 2026
Merged

fix(ligretto): preserve game state on resume#647
Themezv merged 2 commits into
masterfrom
fix/issue-643-resume-game

Conversation

@memebattle-dev

Copy link
Copy Markdown
Contributor

Summary

  • add a dedicated shared websocket contract and separate frontend/backend path for resuming paused games
  • resume by changing only GameStatus.Pause to GameStatus.InGame, preserving players, decks, cards, playground, spectators, and configuration
  • restrict resume requests to the game host and ignore unknown games without broadcasting
  • keep fresh-round start initialization separate and label the paused host action as Resume
  • add backend controller, frontend listener, dispatch, and button-label regression coverage

Tests

  • pnpm --filter @memebattle/ligretto-gameplay-backend test — 2 files, 17 tests passed
  • pnpm --filter @memebattle/ligretto-gameplay-backend ts-check — passed
  • pnpm test:ci && pnpm ts-check in apps/ligretto-frontend — 8 files, 58 tests passed; typecheck passed
  • pnpm lint:check — passed
  • pnpm fmt:check — passed
  • root pnpm test:ci — passed across the workspace
  • root pnpm ts-check — all Ligretto/shared projects passed; the command retains the existing failure in untouched apps/blog generated Next route/layout types where locale is widened to string
  • independent staged-diff review — passed after adding host authorization and unknown-game guards

Risks

  • resume is intentionally immediate and does not reuse the fresh-round countdown
  • invalid lifecycle requests preserve state; unauthorized and unknown-game requests are ignored without broadcast

Fixes #643

@memebattle-dev
memebattle-dev force-pushed the fix/issue-643-resume-game branch from f2aeff7 to 170520c Compare August 16, 2026 09:11
@memebattle-dev

Copy link
Copy Markdown
Contributor Author

Rebased this branch onto the current master and pushed commit 170520c to harden resume concurrency: host authorization and the paused-state transition are now atomic, rejected resumes do not broadcast, and successful resumes broadcast the freshest canonical game. Added deterministic regression coverage for stale-host and concurrent-update races. Local workspace tests, lint, and format checks passed; root typecheck retains only the pre-existing untouched apps/blog generated Next type errors. All PR checks are green.

@Themezv
Themezv merged commit 9e8e22b into master Aug 16, 2026
6 checks passed
@Themezv
Themezv deleted the fix/issue-643-resume-game branch August 16, 2026 20:06
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.

Ligretto: preserve game state when resuming from pause

2 participants