Repository navigation
fix(game): preserve concurrent lobby updates - #287
Draft
tonmarcondes wants to merge 1 commit into
Draft
tonmarcondes wants to merge 1 commit into
tonmarcondes wants to merge 1 commit into
Conversation
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.
When several players join together, the teacher lobby can omit a participant even though every player has joined successfully. The join/remove/kick handlers close over the previously rendered playerList, so queued updates can overwrite each other before React commits a render.
Use functional state updates for NEW_PLAYER, REMOVE_PLAYER and PLAYER_KICKED, matching the existing PLAYER_UPDATED handler. Each event now applies to the latest queued list.
Add a browser regression using six independent player contexts joining concurrently. It checks every name is visible before and after a manager reload, then kicks one participant and verifies the player returns to PIN entry and the remaining five names stay in the lobby. Against unchanged dev at 602de66, all six joins succeeded but only five names appeared in the teacher view.
Validation on Node 26.13.0 / pnpm 11.28.7:
Based directly on upstream dev and independent of #286. Only the three state updates and their browser regression are included; no avatar, account, dependency, locale or deployment changes. Kept as a draft until exact-head upstream CI can run and pass.