Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Share the RoomService transport and add DeleteRoom

Cerrado
#320 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
rust
Área
api, backend

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.rs and move post_room_service and livekit_room_service_request into 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) and validate_livekit_credentials in rooms.rs, calling the moved transport with the fields from AgentConfig.
  • Add livekit_room_create_token beside livekit_room_admin_token (src/token.rs:111). It grants roomCreate: true and nothing else, since LiveKit requires roomCreate for 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 Twirp not_found code returns Ok, 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.rs pass unedited.
  • A new tests/unit/livekit/room_service.rs runs a local axum stub and asserts that delete_room posts to /twirp/livekit.RoomService/DeleteRoom with a bearer token that holds roomCreate and not roomAdmin.
  • The same file asserts that a not_found reply returns Ok and that another failure, such as a 500, returns an error.
  • tests/token.rs asserts the claims of livekit_room_create_token, including that it carries no roomAdmin, roomJoin or roomList, and adds it to every_token_expires.
  • ./scripts/test.sh passes, 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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de sysprog21/codetrial

Todos los issues de sysprog21/codetrial

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.