Skip to content

fix(game): preserve concurrent lobby updates - #287

Draft
tonmarcondes wants to merge 1 commit into
Ralex91:devfrom
tonmarcondes:fix/simultaneous-lobby-updates-upstream
Draft

tonmarcondes wants to merge 1 commit into
Ralex91:devfrom
tonmarcondes:fix/simultaneous-lobby-updates-upstream

Conversation

@tonmarcondes

Copy link
Copy Markdown

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:

  • Frozen installation, format:fix, lint:fix, format, lint, build and all 221 unit/integration tests passed.
  • The full 47-scenario browser suite passed locally with one worker on 62b9341.

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.

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