Repository navigation
Add RoomEvent.RoomSidChanged - #2155
biglittlebigben wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: b9eb1e6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
lukasIO
left a comment
There was a problem hiding this comment.
this makes sense to me.
One question: how are users expected to react to this (if at all) or is it purely informational?
A RoomSidChange was previously implicit via a RoomMoved event. Now we're emitting both RoomMoved and RoomSidChange in short succession.
I'm wondering if it makes sense to include a reason param or similar in the RoomSidChange event in order for users to be able to infer why the Sid has changed (and potentially deduplicate the RoomSidChange with a following RoomMoved event in their event handling logic).
Afaict we would currently only be able to infer that it happens because of a room move, not sure if it's worth it though.
This currently happens in some pathological room lifecycle situations where we hear late that a room we thought was deleted actually had a participant connect to it. Clients who have logic that relies on the RoomID should take note. However in an ideal world the RoomID would not change in these cases. We are working on improving these situations but it may take a while as it involves a fairly large and risky change to the way we allocate IDs. Egress particularly cares about this to make sure active egresses don't get swept. I can add a reason field, but what would be an appropriate reason for "race condition in room lifecycle logic"? |
Summary
RoomEvent.RoomSidChanged(args:sid: string), emitted fromhandleRoomUpdatewhen an update carries a non-empty session ID different from the last known one — e.g. the server starting a new session for a room that is still live, or a move.getSid()returns the new ID.emitWhenConnected, so it is not emitted for the initial join and is buffered across reconnects.Testing
room updatestest inRoom.test.ts;vitest,tscandeslintpass. The Playwright smoke spec is not runnable locally (@playwright/testmissing), same onmain.🤖 Generated with Claude Code