MULTIPLAYER: resume server-hosted rooms after reload#5359
Merged
matthewevans merged 4 commits intoJul 9, 2026
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
91b03a4 to
d56eaaf
Compare
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
a560563 to
2247739
Compare
Member
|
@davidomil is this something you had an opportunity to test? |
Contributor
Author
|
Yes. Works on my local host. What I do is I have http reverse proxy with basic auth that goes into cloud flare zero trust tunnel. These changes were required for it to work reliably. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restores server-hosted pregame rooms after a browser reload by persisting host-session metadata with the WebSocket reconnect token. Also moves LAN HTTP
crypto.randomUUID()support into client source and fixes the join flow so connection-scoped seat reservation tokens are not carried from a lobby lookup socket into a later game join socket.Behavioral note
The reservation issue is easiest to hit on Full-mode servers. The official multiplayer deployment currently behaves as a LobbyOnly broker, so the pre-fix P2P join path resolved the guest over the same long-lived lobby socket that created the reservation. Full-mode self-hosted servers run the actual game on the server, so deck selection previously reserved a seat on the lobby socket, then the game route opened a new WebSocket and tried to use that token there. The server correctly rejected that as a foreign reservation.
Seat reservations are intentionally bound to the WebSocket connection that received them. This PR keeps the deck-selection lookup read-only and clears stale reservation handoff storage before opening the game WebSocket.
Implementation method (required)
How was the engine/parser logic in this PR produced? Check exactly one:
/engine-implementerpipeline (plan → review-plan → implement → review-impl → commit)/engine-implementer— explain why belowIf you did not use
/engine-implementer, state why (e.g. frontend-onlychange, docs/CI/tooling change, release chore, or a fix too small to warrant
the pipeline):
Note
Any change to
crates/engine/game logic — parser, effects, resolver,targeting, rules behavior — is expected to go through
/engine-implementer.The "not used" box is for changes that genuinely fall outside that scope.
CR references
None.
Verification
./node_modules/.bin/vitest run src/services/__tests__/multiplayerSession.test.ts src/polyfills/__tests__/cryptoRandomUUID.test.ts src/stores/__tests__/multiplayerStore.test.ts— passed, 25 tests../node_modules/.bin/vitest run src/services/__tests__/brokerClient.test.ts src/stores/__tests__/multiplayerStore.test.ts src/services/__tests__/multiplayerSession.test.ts src/polyfills/__tests__/cryptoRandomUUID.test.ts— passed, 34 tests.node ../scripts/check-protocol-version.mjs && ./node_modules/.bin/tsc -b --noEmit— passed../node_modules/.bin/eslint src/pages/MultiplayerPage.tsx src/providers/GameProvider.tsx src/stores/multiplayerStore.ts src/services/__tests__/brokerClient.test.ts— passed.cargo test -p lobby-broker foreign_— passed, 2 tests.ServerHellocomparison confirmed the official multiplayer deployment is LobbyOnly while the affected self-hosted deployment was Full mode.a56056306301f60a2f53cbb078d513ac7ec41378verified the expected build commit, protocol version, and Full mode inServerHello.phase-join-reservation:*storage before navigation.You may only release or use a seat reservation issued to this connectionerrors after the fix.