mirror of
https://github.com/livekit/livekit.git
synced 2026-09-29 13:19:15 +00:00
* rtc: split EndSession out of MoveToRoom A participant's session in a room can end without the participant closing: today on a move, and next on a room re-key, where a room ended by the sweeper while participants were joining restarts under a new room id with the same participants in it. EndSession is the room-independent half of MoveToRoom: report the published tracks unpublished, report the session end, run the caller's leave under the ending session's telemetry guard, then take a fresh guard and reset the deferred resolvers for the next session. The guard matters: ParticipantLeft releases it and the telemetry service refuses to open a stats worker for a released guard, so without a fresh one the next session's join would silently get no worker. MoveToRoom keeps the subscriber teardown and the onClose fan-out, passed in as the leave. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * rtc: rename EndSession to LeaveSession, add JoinSession EndSession read as terminal, but the participant survives it and joins another session, so name the pair for what happens to the participant: LeaveSession and JoinSession. JoinSession is the other half that review pointed out was missing from the API: the caller reports the join, then the published tracks are reported published again under the new session, pairing the unpublish LeaveSession reported. Without it the re-publish lived only in the caller, with nothing in OSS proving the two halves balance. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>