dograh/ui/src
Aymenbenpakiss 37c4bda0c7
fix(ui): release microphone stream on call teardown so a second test call works (#446)
* fix(ui): release microphone stream on call teardown

The browser "Call Voice Agent" test call worked only once per page load.
A second attempt failed (mic stuck / "Could not acquire media") until the
user reloaded the page or cleared site data and re-granted mic permission.

Root cause: the MediaStream from getUserMedia() was added to the peer
connection but never retained or explicitly stopped on teardown. On hangup
only sender.track.stop() (via pc.getSenders()) ran; browsers can keep the
microphone device held through the original MediaStream reference, so the
next getUserMedia() is blocked.

Fix: keep the stream in localStreamRef and stop all of its tracks in
cleanupConnection() (the shared teardown path) and in the unmount cleanup,
so the device is fully released between calls.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(ui): harden microphone release in webrtc hook and embed widget

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: AYMENPAKISS2 <tech.nomatrade@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Abhishek Kumar <abhishek@a6k.me>
2026-06-18 12:47:14 +05:30
..
app fix(ui): release microphone stream on call teardown so a second test call works (#446) 2026-06-18 12:47:14 +05:30
client feat: UI refresh and user onboarding (#430) 2026-06-17 19:49:33 +05:30
components feat: add custom sarvam tts voice (#449) 2026-06-18 12:33:21 +05:30
constants feat: UI refresh and user onboarding (#430) 2026-06-17 19:49:33 +05:30
context feat: UI refresh and user onboarding (#430) 2026-06-17 19:49:33 +05:30
hooks feat: add chat based testing for voice agent (#308) 2026-05-21 15:20:02 +05:30
lib feat: UI refresh and user onboarding (#430) 2026-06-17 19:49:33 +05:30
types feat: add config v2 to simplify billing (#428) 2026-06-09 16:10:26 +05:30
instrumentation-client.ts debug: add SentryErrorBoundary 2026-05-12 17:48:01 +05:30
instrumentation.ts feat: refactor node spec and add mcp tools (#244) 2026-04-21 07:56:16 +05:30
middleware.ts feat: UI refresh and user onboarding (#430) 2026-06-17 19:49:33 +05:30