Share the RoomService transport and add DeleteRoom
I maintainer di solito rispondono entro 1 giorno
Una pull request collegata è già stata integrata.
- #325 di @dges5202 — integrata
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with the private post_room_service and livekit_room_service_request in src/livekit/rooms.rs (around lines 122 and 138), then the token helper livekit_room_admin_token in src/token.rs near line 111. The work moves the transport into a new src/livekit/room_service.rs, adds livekit_room_create_token and delete_room, and extends tests/unit/livekit/rooms.rs, tests/token.rs and a new tests/unit/livekit/room_service.rs. Done means the existing room tests pass unedited, the new axum-stub tests cover the DeleteRoom request, the 404 not_found case and the 500 error case, and ./scripts/test.sh passes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Context
This issue separates P4 from #306 so it can be worked on independently. The peer sweeper (P11) has to delete a LiveKit room once a peer session ends, but the only RoomService client today lives in src/livekit/rooms.rs: post_room_service and livekit_room_service_request (src/livekit/rooms.rs:122, :138) are private to the agent's duplicate-participant handling, and livekit_room_service_request reads its credentials from AgentConfig, which codetrial web does not load.
Desired outcome
A RoomService client that any server-side caller can use with a LiveKit URL, API key and API secret, plus a delete_room call for cleanup. Agent behavior stays exactly as it is.
Proposed implementation
- Add
src/livekit/room_service.rsand movepost_room_serviceandlivekit_room_service_requestinto it. The request function takes(url, api_key, api_secret)instead of&AgentConfig. - Keep the duplicate-agent handling (
isolate_local_agent,remove_room_participant,is_participant_gone) andvalidate_livekit_credentialsinrooms.rs, calling the moved transport with the fields fromAgentConfig. - Add
livekit_room_create_tokenbesidelivekit_room_admin_token(src/token.rs:111). It grantsroomCreate: trueand nothing else, since LiveKit requiresroomCreatefor DeleteRoom. - Add
delete_room(url, api_key, api_secret, room, now_seconds), which posts{"room": room}to/twirp/livekit.RoomService/DeleteRoom. A 404 whose body carries the Twirpnot_foundcode returnsOk, because a room that is already gone is the outcome cleanup wants. Any other non-success status is an error that names the method, the status and the body.
Acceptance criteria
- The existing cases in
tests/unit/livekit/rooms.rspass unedited. - A new
tests/unit/livekit/room_service.rsruns a local axum stub and asserts thatdelete_roomposts to/twirp/livekit.RoomService/DeleteRoomwith a bearer token that holdsroomCreateand notroomAdmin. - The same file asserts that a
not_foundreply returnsOkand that another failure, such as a 500, returns an error. -
tests/token.rsasserts the claims oflivekit_room_create_token, including that it carries noroomAdmin,roomJoinorroomList, and adds it toevery_token_expires. -
./scripts/test.shpasses, with any skipped lanes reported in the pull request.
Scope
This adds the transport and DeleteRoom only. It does not call CreateRoom, does not add any peer caller (that is P11), and does not change the tokens or the RoomService calls the agent already makes.
Ownership
I will implement this issue and open the pull request.
Refs #306
- Lingua principale
- Rust
- Stelle
- 160
- Fork
- 64
- Merge medio
- 1g 12h
- PR unite (30g)
- 124
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sysprog21/codetrial
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
sysprog21/codetrial#318 · 3 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Candidate test cases persist across interviews for the same problem in the same tabForse già presa @MZGamer l’ha presa oggi. Aperta
sysprog21/codetrial#336 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
A correct C solution to Clone Graph does not compileForse già presa @Wu-1127 l’ha presa 1 giorno fa. Aperta
sysprog21/codetrial#332 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Run the live interviewer on a local speech pipelineForse già presa @alanhc l’ha presa oggi. Aperta
sysprog21/codetrial#330 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Let the candidate undo Continue without camera in the preflightForse già presa @HALA1028 l’ha presa 1 giorno fa. Aperta
sysprog21/codetrial#327 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di sysprog21/codetrial
Issue simili
-
The book has a Nix install section that chelis.ch lacks, and it names two of the three systemsApertaarea:ecosystem documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Chelis-Lang/chelis#3866 ·
I maintainer di solito rispondono entro 1 giorno
-
bug documentation sev-0
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
dekobon/big-code-analysis#1620 ·
I maintainer di solito rispondono entro 3 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100