Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Share the RoomService transport and add DeleteRoom

Chiusa
#320 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
api, backend

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.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

Lingua principale
Rust
Stelle
160
Fork
64
Merge medio
1g 12h
PR unite (30g)
124

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sysprog21/codetrial

Tutte le issue di sysprog21/codetrial

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.