chore(voice): drop debug toasts; appease rubocop on inbox jbuilder
- Remove the [debug] useAlert breadcrumbs that surfaced the accept-call
silent-fail (the !conversation guard). The actual fix from
6ed9500792 stays.
- Rubocop Style/IfUnlessModifier on the WhatsApp voice_enabled jbuilder
block — convert to modifier form.
This commit is contained in:
@@ -4,7 +4,6 @@ import { useRouter } from 'vue-router';
|
||||
import { useStore } from 'vuex';
|
||||
import { useCallSession } from 'dashboard/composables/useCallSession';
|
||||
import { setWhatsappCallMuted } from 'dashboard/composables/useWhatsappCallSession';
|
||||
import { useAlert } from 'dashboard/composables';
|
||||
import WindowVisibilityHelper from 'dashboard/helper/AudioAlerts/WindowVisibilityHelper';
|
||||
import Avatar from 'dashboard/components-next/avatar/Avatar.vue';
|
||||
|
||||
@@ -75,15 +74,7 @@ const handleEndCall = async () => {
|
||||
};
|
||||
|
||||
const handleJoinCall = async call => {
|
||||
useAlert('[debug] handleJoinCall click handler fired');
|
||||
if (!call) {
|
||||
useAlert('[debug] handleJoinCall bailed: no call object');
|
||||
return;
|
||||
}
|
||||
if (isJoining.value) {
|
||||
useAlert('[debug] handleJoinCall bailed: already joining');
|
||||
return;
|
||||
}
|
||||
if (!call || isJoining.value) return;
|
||||
const { conversation } = getCallInfo(call);
|
||||
|
||||
// End current active call before joining new one
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
cleanupWhatsappSession,
|
||||
} from 'dashboard/composables/useWhatsappCallSession';
|
||||
import { handleVoiceCallCreated } from 'dashboard/helper/voice';
|
||||
import { useAlert } from 'dashboard/composables';
|
||||
import Timer from 'dashboard/helper/Timer';
|
||||
|
||||
const isWhatsappCall = call => call?.provider === 'whatsapp';
|
||||
@@ -123,34 +122,22 @@ export function useCallSession() {
|
||||
};
|
||||
|
||||
const joinCall = async ({ conversationId, inboxId, callSid }) => {
|
||||
useAlert(`[debug] joinCall: callSid=${callSid} inboxId=${inboxId}`);
|
||||
if (isJoining.value) {
|
||||
useAlert('[debug] joinCall bailed: isJoining flag stuck');
|
||||
return null;
|
||||
}
|
||||
if (isJoining.value) return null;
|
||||
|
||||
isJoining.value = true;
|
||||
try {
|
||||
const call = findCall(callSid);
|
||||
useAlert(
|
||||
`[debug] found call? provider=${call?.provider} callId=${call?.callId} hasSdpOffer=${Boolean(call?.sdpOffer)}`
|
||||
);
|
||||
if (isWhatsappCall(call)) {
|
||||
useAlert('[debug] taking WhatsApp accept path');
|
||||
await whatsappSession.acceptIncomingCall({
|
||||
callId: call.callId,
|
||||
sdpOffer: call.sdpOffer,
|
||||
iceServers: call.iceServers,
|
||||
});
|
||||
useAlert('[debug] /accept POST succeeded');
|
||||
callsStore.setCallActive(callSid);
|
||||
durationTimer.start();
|
||||
return { callId: call.callId };
|
||||
}
|
||||
|
||||
useAlert(
|
||||
`[debug] taking Twilio path — provider mismatch: ${call?.provider}`
|
||||
);
|
||||
const device = await TwilioVoiceClient.initializeDevice(inboxId);
|
||||
if (!device) return null;
|
||||
|
||||
@@ -171,7 +158,6 @@ export function useCallSession() {
|
||||
|
||||
return { conferenceSid: joinResponse?.conference_sid };
|
||||
} catch (error) {
|
||||
useAlert(`[debug] joinCall threw: ${error?.message || 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
|
||||
|
||||
Reference in New Issue
Block a user