Skip to content

fix(relay): notify and stop replaced party connections - #384

Merged
Alban1911 merged 1 commit into
Alban1911:mainfrom
Lng999:fix/relay-replacement-20261020
Oct 20, 2026
Merged

Alban1911 merged 1 commit into
Alban1911:mainfrom
Lng999:fix/relay-replacement-20261020

Conversation

@Lng999

@Lng999 Lng999 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

When the same player joined a party room from another connection, the relay removed the old socket from the room without notifying it. A still-running Rose kept receiving ping responses, retained stale members and believed it could publish skins, although the room ignored its updates. The old socket could also send another join and replace the newer connection.

Send a replaced message before removing the old connection, and ignore subsequent joins from removed sockets. Preserve the relay's existing avoidance of server-initiated closes. Rose treats replacement as final: clear stale members, close its socket without sending leave, stop publishing and stop automatic reconnection. Explicit resume can establish a new connection. The legacy close reason replaced remains supported.

A maintainer must deploy the relay changes with wrangler deploy for rose-party-relay; this PR does not deploy them. An updated client against the current server receives no replacement message, so the existing limitation remains. Older clients ignore the new message and retain their current behavior. No storage migration or compatibility-date change is needed.

Validation:

  • python -m unittest party.tests.test_relay_replaced: 6 pass; 4 fail against base 146f7986. Coverage includes replacement cleanup, ordinary reconnect, legacy close behavior and explicit resume.
  • An uncommitted mocked Durable Object/WebSocket runtime harness passes; the base server fails its replacement-notification check. Relay TypeScript checking passes with lockfile versions. No server regression test is committed.
  • Combined audit integration verification passes 367 Python tests, 5 JavaScript tests and Ruff; git diff --check passes.

@Alban1911
Alban1911 merged commit 6badb1b into Alban1911:main Oct 20, 2026
3 of 4 checks passed
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.

2 participants