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
@@ -225,6 +225,9 @@ class ActionCableConnector extends BaseActionCableConnector {
provider: 'whatsapp',
sdpOffer: data.sdp_offer,
iceServers: data.ice_servers,
// Caller info for the FloatingCallWidget so it doesn't show "Unknown caller"
// before the conversation/contact has loaded into the store.
caller: data.caller,
});
};
+5 -1
View File
@@ -26,6 +26,8 @@ function extractCallData(message) {
const call = message?.call || {};
return {
callSid: call.provider_call_id,
callId: call.id,
provider: call.provider,
status: call.status,
callDirection: call.direction === 'outgoing' ? 'outbound' : 'inbound',
conversationId: message?.conversation_id,
@@ -36,7 +38,7 @@ function extractCallData(message) {
export function handleVoiceCallCreated(message, currentUserId) {
if (!isVoiceCallMessage(message)) return;
const { callSid, callDirection, conversationId, senderId } =
const { callSid, callId, provider, callDirection, conversationId, senderId } =
extractCallData(message);
if (shouldSkipCall(callDirection, senderId, currentUserId)) return;
@@ -44,6 +46,8 @@ export function handleVoiceCallCreated(message, currentUserId) {
const callsStore = useCallsStore();
callsStore.addCall({
callSid,
callId,
provider,
conversationId,
callDirection,
senderId,