Skip to content

fix: hide opponent hand when rematching a reopened finished game - #1433

Open
SamuelHetes wants to merge 3 commits into
cuttle-cards:mainfrom
SamuelHetes:bug/1385-rematch-hand-revealed
Open

SamuelHetes wants to merge 3 commits into
cuttle-cards:mainfrom
SamuelHetes:bug/1385-rematch-hand-revealed

Conversation

@SamuelHetes

Copy link
Copy Markdown

Issue number

Reopening a finished game joined the original player to the spectator socket room, causing their next rematch to reveal the opponent's hand. Keep players in their p0/p1 rooms in both game-loading and spectate actions, while preserving full visibility when viewing finished games.

Please check the following

  • Do the tests still pass?
  • Is the code formatted properly?
  • For New Features:
    • Have tests been added to cover any new features or fixes?
    • Has the documentation been updated accordingly? (N/A: bug fix with no new user-facing workflow.)

Please describe additional details for testing this change

  1. Start a game with two accounts and concede.
  2. Go Home, then reopen the finished game via its URL or browser Back.
  3. Accept a rematch with both accounts. The opponent's hand should stay hidden, including after their next draw.

Added Cypress regressions for both navigation paths and 20 controller unit tests covering player/spectator rooms, visibility, and live-game self-spectating restrictions. The URL regression failed before the fix and passed afterward.

Validation on Node 22.21.1: lint and build passed; all 106 unit tests passed. All 34 standard E2E specs were run: final results were 387 passed and 5 existing pending tests. One game-creation setup timeout in live-spectating.spec.js passed on an isolated rerun of the entire spec (12/12), without code changes. GitHub CI remains to be run.

Copilot AI balanced review requested due to automatic review settings October 10, 2026 16:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@itsalaidbacklife itsalaidbacklife added bug Something isn't working version-patch An update that warrants a bumping the project's patch version (e.g. 4.0.0 => 4.0.1) backend Requires changes to the (node) backend webserver labels Oct 10, 2026

@itsalaidbacklife itsalaidbacklife left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. Thanks for the fix! One nitpick on the e2e test and then this is ready

Comment thread tests/e2e/specs/in-game/game-over/rematch.spec.js Outdated
Copilot AI balanced review requested due to automatic review settings October 12, 2026 13:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Requires changes to the (node) backend webserver bug Something isn't working version-patch An update that warrants a bumping the project's patch version (e.g. 4.0.0 => 4.0.1)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Opponent hand sometimes revealed on starting a rematch game

3 participants