Fix inbound voice call ownership flow

This commit is contained in:
Muhsin
2026-03-11 20:50:08 +04:00
parent 6e46be36c8
commit fac4675dc5
14 changed files with 518 additions and 50 deletions
@@ -15,6 +15,7 @@ import * as Sentry from '@sentry/vue';
import {
handleVoiceCallCreated,
handleVoiceCallUpdated,
syncConversationCallVisibility,
} from 'dashboard/helper/voice';
export const hasMessageFailedWithExternalError = pendingMessage => {
@@ -391,18 +392,19 @@ const actions = {
}
},
updateConversation({ commit, dispatch }, conversation) {
const {
meta: { sender },
} = conversation;
updateConversation({ commit, dispatch, rootGetters }, conversation) {
const sender = conversation.meta?.sender;
commit(types.UPDATE_CONVERSATION, conversation);
syncConversationCallVisibility(conversation, rootGetters?.getCurrentUserID);
dispatch('conversationLabels/setConversationLabel', {
id: conversation.id,
data: conversation.labels,
});
dispatch('contacts/setContact', sender);
if (sender) {
dispatch('contacts/setContact', sender);
}
},
updateConversationLastActivity(
@@ -1,4 +1,5 @@
import axios from 'axios';
import { createPinia, setActivePinia } from 'pinia';
import actions, {
hasMessageFailedWithExternalError,
} from '../../conversations/actions';
@@ -56,6 +57,11 @@ describe('#hasMessageFailedWithExternalError', () => {
});
describe('#actions', () => {
beforeEach(() => {
setActivePinia(createPinia());
vi.clearAllMocks();
});
describe('#getConversation', () => {
it('sends correct actions if API is success', async () => {
axios.get.mockResolvedValue({