Share the RoomService transport and add DeleteRoom
Los mantenedores suelen responder en 1 día
Ya se ha fusionado un pull request relacionado.
- #325 de @dges5202 — fusionado
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Rust
- Estrellas
- 160
- Forks
- 64
- Merge medio
- 1 d 11 h
- PR fusionados (30 d)
- 132
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de sysprog21/codetrial
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Add a Copy code button to the final reportPosiblemente ocupada @yansawu la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
sysprog21/codetrial#318 · 5 comentarios · 2 reacciones · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Show problem difficulty in past attempt labelsPosiblemente ocupada @yuen0428 la tomó hoy. Abierto
sysprog21/codetrial#357 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Add keyboard undo and redo to whiteboard interviewsPosiblemente ocupada @xuntla la tomó hoy. Abierto
sysprog21/codetrial#352 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Let the candidate restore the starter codePosiblemente ocupada @RWong04 la tomó hoy. Abierto
sysprog21/codetrial#348 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de sysprog21/codetrial
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
521xueweihan/HelloGitHub#4023 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
cloudflare/pingora#1055 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
nautechsystems/nautilus_trader#5365 ·
Los mantenedores suelen responder en 1 día