Conversation
…room_finished ParticipantInfo is written by the person's own client on join and leave and dropped by the server only when the person goes fully offline. When the client goes away mid-call (reload, crash, network loss) LiveKit drops the participant but the record keeps pointing at the room: the person is shown as a member indefinitely, cannot re-establish the call, and nobody can remove them (Kick exists only for an office owner in their own office). The Love service already receives LiveKit webhooks. Handle participant_left by moving that person's record out of the room (to their office, else reception) and room_finished by doing so for everyone still recorded in it - the same update the client's own kick performs, so the server-side room triggers apply as usual. Filtering by room keeps a late event harmless for someone who has already moved on to another room. Failures are logged and never fail the webhook. Signed-off-by: Ayush Nigade <ayush@mirro.ai>
Author
|
Closing; will be resubmitted from the correct account. |
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.
Companion to #11029 (client side). This one fixes the state for everyone else, server side.
Description of the issue
ParticipantInfo(who is in which Love room) is written only by the person's own client, on join and on leave, and dropped by the server only when the person goes fully offline (OnUserStatus). When the client goes away mid-call — page reload, crash, laptop lid, network loss — LiveKit drops the participant, but the record keeps pointing at the room. The person stays listed as a member of the room for everyone, indefinitely, and nobody can remove them: the client offers Kick only to an office owner inside their own office.The Love service already receives LiveKit webhooks (
/webhook, used foregress_ended) and logsroom_started/room_finishedwithout acting on them.Steps to reproduce
Expected behaviour
Once LiveKit has dropped the participant, the room no longer lists them.
Actual behaviour
They remain listed in the room until they go fully offline. On a self-hosted instance we saw a user pinned to a room this way for the rest of the day; LiveKit had logged
participant closing … CLIENT_REQUEST_LEAVEat the moment of the reload.Fix
services/love/src/rooms.ts:parseRoomName(workspace = first_segment, room id = last; room names may contain underscores) andresetRoomParticipants(client, roomId, person?), which moves each matchingParticipantInfoto the person's office or tolove.ids.Reception— the same update the client'skick()performs, so the existingOnParticipantInfotriggers keepRoomInfo/ meeting minutes consistent.WorkspaceClient:leaveRoom(person, roomId)andclearRoom(roomId)over the existing system-tokenTxOperations./webhook:participant_left→leaveRoom(identity, roomId)(the LiveKit identity is the HulyPerson._idthe client posts to/getToken);room_finished→clearRoom(roomId). Filtering by room makes a lateparticipant_leftharmless for someone who already moved to another room. Errors are logged and the webhook still returns 200 so LiveKit does not retry forever.LiveKit only emits
participant_leftafter the participant is fully gone (past its reconnect window), so no extra grace period is needed. Agent / bot identities have noParticipantInfoand are a no-op. No new configuration: deployments that already receive egress webhooks get this for free.Testing
Unit tests for
parseRoomNameandresetRoomParticipants(services/love/src/__tests__/rooms.test.ts): office target, reception fallback, person already elsewhere, whole-room reset. The reset write itself was verified on a self-hosted v0.7.432 instance through the transactor API (it is what freed the stuck user).Developed with AI assistance; reviewed and tested by the author.