fix(voice): merge call store entries so cable + message.created races don't drop provider/sdp/caller

This commit is contained in:
Tanmay Deep Sharma
2026-05-01 10:54:47 +07:00
parent 0567655840
commit 7663e2ac30
4 changed files with 25 additions and 5 deletions
+7 -2
View File
@@ -32,8 +32,13 @@ export const useCallsStore = defineStore('calls', {
addCall(callData) {
if (!callData?.callSid) return;
const exists = this.calls.some(call => call.callSid === callData.callSid);
if (exists) return;
const existing = this.calls.find(c => c.callSid === callData.callSid);
if (existing) {
// Merge so a later cable event with sdp_offer/provider/caller fills in
// gaps left by the earlier message.created path (and vice versa).
Object.assign(existing, callData, { isActive: existing.isActive });
return;
}
this.calls.push({
...callData,