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:
Tanmay Deep Sharma
2026-05-03 15:40:30 +07:00
parent 5aa1df81a8
commit 499ac053ee
3 changed files with 3 additions and 28 deletions
@@ -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