The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
fix(call-recorder): listen proper updated fileds event (#23135)
martmulle0debf87a71b
diff --git a/packages/twenty-apps/public/call-recorder/package.json b/packages/twenty-apps/public/call-recorder/package.jsonindex 26f31c547cc..550ae27ec5f 100644--- a/packages/twenty-apps/public/call-recorder/package.json+++ b/packages/twenty-apps/public/call-recorder/package.json@@ -1,6 +1,6 @@{"name": "@twentyhq/call-recorder",- "version": "1.4.0",+ "version": "1.5.0","license": "MIT","engines": {"node": "^24.5.0",diff --git a/packages/twenty-apps/public/call-recorder/src/logic-functions/__tests__/schedule-recall-bot-on-call-recording-update.test.ts b/packages/twenty-apps/public/call-recorder/src/logic-functions/__tests__/schedule-recall-bot-on-call-recording-update.test.tsindex d124f075396..e705c3e54c0 100644--- a/packages/twenty-apps/public/call-recorder/src/logic-functions/__tests__/schedule-recall-bot-on-call-recording-update.test.ts+++ b/packages/twenty-apps/public/call-recorder/src/logic-functions/__tests__/schedule-recall-bot-on-call-recording-update.test.ts@@ -1,6 +1,8 @@import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';-import { scheduleRecallBotOnCallRecordingUpdateHandler } from 'src/logic-functions/schedule-recall-bot-on-call-recording-update';+import scheduleRecallBotOnCallRecordingUpdateLogicFunction, {+ scheduleRecallBotOnCallRecordingUpdateHandler,+} from 'src/logic-functions/schedule-recall-bot-on-call-recording-update';const queryMock = vi.hoisted(() => vi.fn());const mutationMock = vi.hoisted(() => vi.fn());@@ -130,6 +132,21 @@ describe('scheduleRecallBotOnCallRecordingUpdateHandler', () => {vi.restoreAllMocks();});+ it('declares the pending-transition fields on the trigger so the server drops other updates', () => {+ expect(+ scheduleRecallBotOnCallRecordingUpdateLogicFunction.config+ .databaseEventTriggerSettings,+ ).toEqual({+ eventName: 'callRecording.updated',+ updatedFields: [+ 'recordingRequestStatus',+ 'status',+ 'externalBotId',+ 'calendarEventId',+ ],+ });+ });+it('schedules a bot when an update clears the bot id of a requested recording', async () => {stubPendingCallRecordingQueries();diff --git a/packages/twenty-apps/public/call-recorder/src/logic-functions/flows/handle-recall-webhook.util.ts b/packages/twenty-apps/public/call-recorder/src/logic-functions/flows/handle-recall-webhook.util.tsindex e840b1130d1..691cf1bc005 100644--- a/packages/twenty-apps/public/call-recorder/src/logic-functions/flows/handle-recall-webhook.util.ts+++ b/packages/twenty-apps/public/call-recorder/src/logic-functions/flows/handle-recall-webhook.util.ts@@ -178,7 +178,6 @@ const queueCallRecordingArtifactsImport = async ({};};-// A throw bubbles to a non-2xx so Svix redelivers; the preceding status update re-applies idempotently.const requestCallRecordingArtifactsImportOrThrow = async ({callRecordingId,}: {diff --git a/packages/twenty-apps/public/call-recorder/src/logic-functions/process-recall-webhook.ts b/packages/twenty-apps/public/call-recorder/src/logic-functions/process-recall-webhook.tsindex e5e6edb82e3..b78e25eca6f 100644--- a/packages/twenty-apps/public/call-recorder/src/logic-functions/process-recall-webhook.ts+++ b/packages/twenty-apps/public/call-recorder/src/logic-functions/process-recall-webhook.ts@@ -5,7 +5,6 @@ import { PROCESS_RECALL_WEBHOOK_LOGIC_FUNCTION_UNIVERSAL_IDENTIFIER } from 'src/import { handleRecallWebhook } from 'src/logic-functions/flows/handle-recall-webhook.util';import { type RecallWebhookBody } from 'src/logic-functions/recall-api/parse-recall-webhook-event.util';-// Dispatched by the recall-webhook resolver; runs in the resolved workspace so the client is workspace-scoped.export const processRecallWebhookHandler = (body: RecallWebhookBody) =>handleRecallWebhook({client: new CoreApiClient(),diff --git a/packages/twenty-apps/public/call-recorder/src/logic-functions/schedule-recall-bot-on-call-recording-update.ts b/packages/twenty-apps/public/call-recorder/src/logic-functions/schedule-recall-bot-on-call-recording-update.tsindex 78c7026129c..be852fb9417 100644--- a/packages/twenty-apps/public/call-recorder/src/logic-functions/schedule-recall-bot-on-call-recording-update.ts+++ b/packages/twenty-apps/public/call-recorder/src/logic-functions/schedule-recall-bot-on-call-recording-update.ts@@ -125,5 +125,6 @@ export default defineLogicFunction({handler: scheduleRecallBotOnCallRecordingUpdateHandler,databaseEventTriggerSettings: {eventName: `${CALL_RECORDING_OBJECT_NAME}.updated`,+ updatedFields: PENDING_TRANSITION_FIELDS,},});