fix(livekit): stable identity + room auto-cleanup
Use the member name as the LiveKit identity (was random per join) so a refresh/rejoin replaces the existing session instead of leaving a ghost participant in the room. Set roomConfig on the token (emptyTimeout 60s, departureTimeout 20s) so empty rooms and departed participants clean up promptly. Pods map 1:1 to a deterministic room name, so joins reuse the same room rather than spawning new ones. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -47,7 +47,9 @@ export default function App() {
|
||||
|
||||
// Connect to a pod's LiveKit room and persist the session for refresh-resume.
|
||||
async function connectToPod(podId: string, who: string) {
|
||||
const identity = `${who}-${Math.random().toString(36).slice(2, 7)}`;
|
||||
// Stable identity per member so a refresh/rejoin replaces the existing
|
||||
// session instead of leaving a ghost participant behind.
|
||||
const identity = who;
|
||||
const result = await joinPod(podId, identity, who);
|
||||
setRoom(result.room);
|
||||
setDevMode(result.mode === 'dev');
|
||||
|
||||
Reference in New Issue
Block a user