Fix permalink join race on reconnect and room-not-found UX#218
Merged
Conversation
Add isReconnecting state to suppress permalink join attempts while the server is restoring session state after a reconnect. The flag is set when the authenticated message has reconnected=true and cleared when onRoomJoined fires (with a 2s safety timeout). Add onGameError callback through the plugin/adapter/hook chain so server error messages (e.g. "Room not found") immediately cancel a pending permalink join and show a clear error with a Create New Room button, instead of waiting for the 10s timeout. Closes #213, closes #214
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
muchq | b37ecd5 | Commit Preview URL Branch Preview URL |
Apr 12 2026, 06:47 PM |
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.
Permalink joins were racing with reconnection state restore — isConnected flips true before the server sends back roomJoined, so the permalink effect would fire a joinRoom into the gap. Added an isReconnecting flag that blocks the effect until restore completes (or a 2s safety timeout).
Also, when a permalink points to a room that no longer exists, the server error was getting swallowed as a generic notification and the user had to wait 10s for the timeout. Now server errors cancel the pending join immediately and show a "room no longer exists" message with a create-room button.
Closes #213, closes #214