Skip to content

Restore online matches after refreshing the page - #10

Draft
Innygr wants to merge 4 commits into
feature/multiplayer-integration-testsfrom
feature/multiplayer-reconnect
Draft

Innygr wants to merge 4 commits into
feature/multiplayer-integration-testsfrom
feature/multiplayer-reconnect

Conversation

@Innygr

@Innygr Innygr commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add GET /api/multiplayer/current, which returns the signed-in guest's own unfinished match or null.
  • On multiplayer page startup, use the existing HttpOnly guest cookie to restore the waiting room or active battle after refresh.
  • Add integration coverage for no current match, waiting-match recovery, active-match recovery, isolation from other guests, and ignoring finished matches.

Security notes

  • The endpoint never accepts a player ID from the client; it derives identity from the existing guest cookie.
  • Match state remains in server memory. This restores after a page refresh while the same server process is running; it does not survive server restarts.

Validation

  • The multiplayer integration workflow is enabled for this stacked PR's base branch so CI can run the existing syntax checks and full API test suite.
  • This is a draft stacked on PR Add automated multiplayer API integration tests #9 and should be reviewed after the integration-test PR is merged.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant