fix(voice): robust accept-with-fetch + remote-end recording race + single-duration bubble + audio playback signals

This commit is contained in:
Tanmay Deep Sharma
2026-05-01 18:29:54 +07:00
parent 1abb51992b
commit d9077c64d3
5 changed files with 71 additions and 5 deletions
@@ -5,6 +5,7 @@ import { useCallsStore } from 'dashboard/stores/calls';
import {
useWhatsappCallSession,
sendWhatsappTerminateBeacon,
cleanupWhatsappSession,
} from 'dashboard/composables/useWhatsappCallSession';
import Timer from 'dashboard/helper/Timer';
@@ -127,6 +128,10 @@ export function useCallSession() {
} catch (error) {
// eslint-disable-next-line no-console
console.error('Failed to join call:', error);
// Tear down any half-built WebRTC state so the user's next click starts
// fresh; otherwise the leftover pc + mic stream survives and confuses
// the second-attempt SDP exchange.
cleanupWhatsappSession();
return null;
} finally {
isJoining.value = false;