feat(livekit): close the room when a pod is deleted

DELETE /api/pods/:id now also calls closeRoom (RoomServiceClient.deleteRoom)
to end the live LiveKit room and disconnect anyone connected. PodView listens
for RoomEvent.Disconnected and returns the user to the pod list, so a deleted
pod cleanly kicks everyone out instead of stranding them in a dead room.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Kartikeya
2026-06-27 17:22:07 -07:00
parent e29fabc3f1
commit 891d4b12bd
3 changed files with 23 additions and 3 deletions
+2 -1
View File
@@ -17,7 +17,7 @@ import {
removeMember,
seedDefaultPods,
} from './pods/store.js';
import { getPresence } from './livekit/rooms.js';
import { getPresence, closeRoom } from './livekit/rooms.js';
import type { InterventionOutcome } from '@podman/shared';
const app = express();
@@ -121,6 +121,7 @@ app.patch('/api/pods/:id', async (req, res) => {
app.delete('/api/pods/:id', async (req, res) => {
const ok = await deletePod(req.params.id);
if (!ok) return res.status(404).json({ error: 'pod not found' });
await closeRoom(req.params.id); // end the live LiveKit room too (kicks anyone connected)
res.json({ ok: true });
});