Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/core/src/api/poll.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { consumeSession } from './consume';
import { AvatarError } from '../error';

export interface PollUntilReadyOptions {
Expand Down Expand Up @@ -79,6 +80,13 @@ export async function pollUntilReady(
'Session is READY but sessionKey is missing',
);
}
// Mark consumed immediately so the worker starts the participant wait
// while the caller prepares the LiveKit connection.
await consumeSession({
sessionId,
sessionKey: session.sessionKey,
baseUrl,
});
return { sessionId, sessionKey: session.sessionKey };
}

Expand Down
Loading