Repository navigation
Share the RoomService transport and add DeleteRoom - #325
Merged
Merged
Conversation
jserv
requested changes
Oct 16, 2026
jserv
left a comment
Contributor
There was a problem hiding this comment.
Check https://github.com/sysprog21/codetrial/blob/main/CONTRIBUTING.md carefully and enforce the rules.
jserv
reviewed
Oct 16, 2026
jserv
reviewed
Oct 16, 2026
jserv
reviewed
Oct 16, 2026
| config, | ||
| &config.livekit_url, | ||
| &config.livekit_api_key, | ||
| &config.livekit_api_secret, |
Contributor
There was a problem hiding this comment.
This leaves two definitions of "already gone". is_room_gone checks the status and the parsed Twirp code. is_participant_gone still searches the formatted error string for "404" and "not_found", so a 500 whose message mentions both still counts as gone. As a follow-up, remove_room_participant could call post_room_service directly and reuse is_room_gone (renamed to something like is_twirp_not_found). That would remove the substring matching.
Peer cleanup has to call LiveKit without an agent config. The existing RoomService client only read credentials from AgentConfig, so the web server could not delete a room. The transport now takes a URL, key and secret. A 2xx that is not JSON is not a deleted room, because a reverse proxy can answer 200 with HTML while the room is still there.
dges5202
force-pushed
the
share-roomservice-delete-room
branch
from
October 16, 2026 07:08
fe307fe to
0e4d10b
Compare
Contributor
|
Thank @dges5202 for contributing! |
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.
Peer room cleanup has to talk to LiveKit without loading an agent config. This PR moves the Twirp POST and the room-admin request helper into
src/livekit/room_service.rs, taking a URL, API key and API secret instead ofAgentConfig. The agent's duplicate-participant handling stays inrooms.rsand calls the moved transport.DeleteRoom is gated on
roomCreate, so a newlivekit_room_create_tokengrants only that.delete_roomtreats a Twirpnot_foundas success, because LiveKit already drops empty rooms and cleanup runs after the fact.P4.
Closes #320
Refs #306
Summary by cubic
Shares the LiveKit RoomService transport between the agent and the web server so peer cleanup can delete rooms without loading an agent config, and adds
delete_roomunder a newroomCreate-only token.Refactors
src/livekit/room_service.rs, taking a URL, API key, and API secret instead ofAgentConfig.delete_roomtreats a Twirpnot_found(status and body code both) as success, since LiveKit drops empty rooms on its own and cleanup runs after the fact; a 2xx that is not JSON is still an error, for the case where a proxy answers 200 with HTML.Closes #320, refs #306.
Written for commit 0e4d10b. Summary will update on new commits.