Skip to content

games_hub: roomLeft is the last frame a leaver gets - #1615

Merged
aaylward merged 1 commit into
mainfrom
claude/leave-room-ack-last
Sep 29, 2026
Merged

aaylward merged 1 commit into
mainfrom
claude/leave-room-ack-last

Conversation

@aaylward

Copy link
Copy Markdown
Collaborator

Bug: leaving the room while seated at a table left the client stuck in a room the hub had already removed it from.

Cause: the hub queued roomLeft before LeaveEverywhere. That function sends the table's gameLeft and a roomState to the room, and the leaver is still a member when that happens. So the leaver received those two frames after the ack. The client (muchq.github.io useLobby) re-entered the room from that late roomState, rewrote the URL back to the room, and got "not in room" on its next command.

Fix: roomLeft is now queued after LeaveEverywhere, so it is the last frame the leaver gets.

Test: LeavingTheRoomFromATableEndsOnRoomLeft fails on the old order (a rummy frame follows roomLeft) and passes now. lobby_wire_test, lobby_e2e_test, voice_wire_test and hub_e2e_test all pass. In a browser against a local hub, "Leave room" from a table now lands on /games with no room panel.

The same commit also rides on #1614. Whichever merges second will see it as already applied.


Generated by Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
1d4-web 58afa5f Commit Preview URL

Branch Preview URL
Sep 29 2026, 04:52 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
iili 58afa5f Commit Preview URL

Branch Preview URL
Sep 29 2026, 04:52 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ast-lol 58afa5f Commit Preview URL

Branch Preview URL
Sep 29 2026, 04:53 PM

@github-actions github-actions Bot added the service:games_hub Changes the games_hub image label Sep 29, 2026
@cursor

cursor Bot commented Sep 29, 2026

Copy link
Copy Markdown

Review panel + Bugbot (58afa5f6)

Four lenses + Bugbot. Bugbot found no bugs. Correctness, resource-safety, tests, and altitude clean. build-and-test green; sanitize still running at post time.

Verdict: LGTM. Right seam — roomLeft after LeaveEverywhere so table gameLeft / membership roomState precede the ack in the same outbox. Wire test bites the old order via the post-ack getRoomState → commandRejected probe (drain-to-roomLeft alone would green either way). Riding the same commit in #1614 is named and merge-order safe.

Soft (pre-existing, not introduced): Stage-then-Deliver outside mu_ can still let a concurrent peer BroadcastRoom / PumpChat land a roomState/roomChat after roomLeft on the wire. Same client hazard, rarer. Out of scope for this one-line fix; optional follow-up if it shows up in the wild.

Optional: one sentence on smithy RoomLeft that the ack is terminal for the leaver (wire test already pins it).

Panel complete.

@aaylward
aaylward enabled auto-merge (squash) September 29, 2026 17:10
@aaylward
aaylward merged commit 63453a1 into main Sep 29, 2026
24 checks passed
@aaylward
aaylward deleted the claude/leave-room-ack-last branch September 29, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

service:games_hub Changes the games_hub image

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants