You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Repeated /api/session/stop against an already absent room
✅ passed: HTTP 200, status=stopped, LiveKit room result marked skipped
Risk
Audio capture, playback, routing, and AEC behavior are unchanged when the browser accepts the requested constraints.
Browsers that report AEC support but return an ineffective setting fail session startup with a diagnostic error.
Repeated stop requests no longer fail solely because the LiveKit room has already gone away; all non-404/not_found cleanup errors still return failure.
[P2] components/livekit/filtered-audio-renderer.tsx:403-411:每次 playing 事件都会 Array.from(audioElements.values()) 遍历全部音频元素计算 activeAudioElementCount,元素较多或事件触发频繁时有轻微开销,可接受但可考虑仅在需要 warn 时计算。
[P2] 新增的 Error('Browser echo cancellation was requested but is not active...') 最终经 useRoom.ts 的 recoverFromStartError 处理,用户侧大概率只看到通用失败提示,无法区分是 AEC 未生效还是其他连接问题。建议保留原始 error 信息以便日志/支持排查(配合上面第一条埋点一起解决)。
[P2] components/livekit/filtered-audio-renderer.tsx:403-411:每次 playing 都 Array.from(audioElements.values()) 遍历全部元素算 activeAudioElementCount,仅用于日志分级。元素多或触发频繁时有轻微开销,可接受,但可考虑仅在需要 warn 时再计算。
[P2] lib/browser-audio-capture.ts:58-66 的 Error('...is not active on the microphone track.') 最终经 useRoom.ts 的 recoverFromStartError 处理,用户侧大概率只看到通用失败提示。建议保留原始 error(或搭配上面第一条埋点)便于排查是否为 AEC 未生效导致。
lanyue-llk
changed the title
fix: Verify browser echo cancellation
fix: Harden browser audio and session cleanup
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Harden the Browser audio baseline and session lifecycle so audio processing is observable and repeated cleanup cannot surface a false runtime failure.
Design
MediaStreamTrack.getSettings()values after capture..env; frontend.env.localis standalone-only.404/not_foundroom deletion as an already-completed stop. Authentication, network, and other LiveKit failures remain fatal.Validation
pnpm test✅ passed: 122 tests from clean commit
ee1836bpnpm exec tsc --noEmit✅ passed: TypeScript
pnpm lint✅ passed: ESLint
pnpm exec prettier --check app/api/session/stop/route.ts lib/session-stop.ts tests/session-stop.test.mjs .env.example✅ passed: Prettier
Repeated
/api/session/stopagainst an already absent room✅ passed: HTTP
200,status=stopped, LiveKit room result markedskippedRisk
404/not_foundcleanup errors still return failure.