Skip to content

The open alternative to Salesforce, designed for AI.

Let the call recorder set the Recording Bot field on calendar events (#28039)

nitine65becd37338
diff --git a/packages/twenty-apps/public/call-recorder/package.json b/packages/twenty-apps/public/call-recorder/package.json
index a33b3b61f55..c857d89ad6b 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.16.0",
+ "version": "1.16.1",
"license": "MIT",
"engines": {
"node": "^24.5.0",
diff --git a/packages/twenty-apps/public/call-recorder/src/__tests__/call-recorder-lifecycle.integration-test.ts b/packages/twenty-apps/public/call-recorder/src/__tests__/call-recorder-lifecycle.integration-test.ts
index bdabbd194ef..c913d49a71f 100644
--- a/packages/twenty-apps/public/call-recorder/src/__tests__/call-recorder-lifecycle.integration-test.ts
+++ b/packages/twenty-apps/public/call-recorder/src/__tests__/call-recorder-lifecycle.integration-test.ts
@@ -1117,7 +1117,9 @@ describe('call recorder app lifecycle (integration)', () => {
// Mocked database-event trigger: runs the reconciliation the
// calendarEvent.* trigger dispatches, then returns the recording it wrote
// to the DB together with its live Recall bot.
- const scheduleRecordingThroughCalendarReconciliation = async (): Promise<{
+ const scheduleRecordingThroughCalendarReconciliation = async (
+ reconciliationClient: CoreApiClient = client,
+ ): Promise<{
calendarEventId: string;
callRecordingId: string;
botId: string;
@@ -1126,7 +1128,7 @@ describe('call recorder app lifecycle (integration)', () => {
const calendarEventId = await createCalendarEvent();
const [reconciliation] = await reconcileCallRecorderForCalendarEventIds({
- client,
+ client: reconciliationClient,
calendarEventIds: [calendarEventId],
});
@@ -3658,13 +3660,20 @@ describe('call recorder app lifecycle (integration)', () => {
});
describe('Recording Bot preference', () => {
+ let applicationClient: CoreApiClient;
+
+ beforeEach(() => {
+ vi.stubEnv('TWENTY_APP_ACCESS_TOKEN', applicationAccessToken);
+ applicationClient = new CoreApiClient();
+ });
+
it('marks a blank preference On when it schedules a bot', async () => {
const calendarEventId = await createCalendarEvent({
callRecorderPreference: null,
});
await reconcileCallRecorderForCalendarEventIds({
- client,
+ client: applicationClient,
calendarEventIds: [calendarEventId],
});
@@ -3686,7 +3695,7 @@ describe('call recorder app lifecycle (integration)', () => {
});
await reconcileCallRecorderForCalendarEventIds({
- client,
+ client: applicationClient,
calendarEventIds: [calendarEventId],
});
@@ -3704,7 +3713,7 @@ describe('call recorder app lifecycle (integration)', () => {
});
await reconcileCallRecorderForCalendarEventIds({
- client,
+ client: applicationClient,
calendarEventIds: [calendarEventId],
});
@@ -3753,7 +3762,7 @@ describe('call recorder app lifecycle (integration)', () => {
}
await reconcileCallRecorderForCalendarEventIds({
- client,
+ client: applicationClient,
calendarEventIds: [calendarEventIds[0]],
});
@@ -3771,7 +3780,7 @@ describe('call recorder app lifecycle (integration)', () => {
it('marks a blank preference On again when it updates an existing scheduled recording', async () => {
const { calendarEventId } =
- await scheduleRecordingThroughCalendarReconciliation();
+ await scheduleRecordingThroughCalendarReconciliation(applicationClient);
await client.mutation({
updateCalendarEvent: {
@@ -3783,7 +3792,7 @@ describe('call recorder app lifecycle (integration)', () => {
},
});
await reconcileCallRecorderForCalendarEventIds({
- client,
+ client: applicationClient,
calendarEventIds: [calendarEventId],
});
@@ -3803,7 +3812,7 @@ describe('call recorder app lifecycle (integration)', () => {
recall.failCalendarEventUpdates = true;
const results = await reconcileCallRecorderForCalendarEventIds({
- client: new CoreApiClient(),
+ client: applicationClient,
calendarEventIds: [calendarEventId],
});
@@ -3824,7 +3833,7 @@ describe('call recorder app lifecycle (integration)', () => {
});
await reconcileCallRecorderForCalendarEventIds({
- client,
+ client: applicationClient,
calendarEventIds: [calendarEventId],
});
@@ -3847,7 +3856,7 @@ describe('call recorder app lifecycle (integration)', () => {
});
await reconcileCallRecorderForCalendarEventIds({
- client,
+ client: applicationClient,
calendarEventIds: [echoedCalendarEventId],
});
@@ -3896,7 +3905,7 @@ describe('call recorder app lifecycle (integration)', () => {
];
await reconcileCallRecorderForCalendarEventIds({
- client,
+ client: applicationClient,
calendarEventIds,
});
@@ -4049,7 +4058,7 @@ describe('call recorder app lifecycle (integration)', () => {
it('clears an On the meeting no longer earns', async () => {
const { calendarEventId, callRecordingId } =
- await scheduleRecordingThroughCalendarReconciliation();
+ await scheduleRecordingThroughCalendarReconciliation(applicationClient);
expect(await fetchCallRecorderPreference(calendarEventId)).toBe('ON');
@@ -4061,7 +4070,7 @@ describe('call recorder app lifecycle (integration)', () => {
});
await reconcileCallRecorderForCalendarEventIds({
- client,
+ client: applicationClient,
calendarEventIds: [calendarEventId],
});
@@ -4083,7 +4092,7 @@ describe('call recorder app lifecycle (integration)', () => {
});
await reconcileCallRecorderForCalendarEventIds({
- client,
+ client: applicationClient,
calendarEventIds: [calendarEventId],
});
diff --git a/packages/twenty-apps/public/call-recorder/src/default-role.ts b/packages/twenty-apps/public/call-recorder/src/default-role.ts
index 2ed3dfd71d3..4a3f4b4dcb6 100644
--- a/packages/twenty-apps/public/call-recorder/src/default-role.ts
+++ b/packages/twenty-apps/public/call-recorder/src/default-role.ts
@@ -11,7 +11,7 @@ export default defineApplicationRole({
universalIdentifier: DEFAULT_ROLE_UNIVERSAL_IDENTIFIER,
label: `${APP_DISPLAY_NAME} default role`,
description:
- 'Reads calendar events to decide whether the call recorder should attend a meeting; writes the resulting CallRecording records, uploads recording media, and fills transcripts and summaries.',
+ 'Reads calendar events to decide whether the call recorder should attend a meeting and sets their Recording Bot field; writes the resulting CallRecording records, uploads recording media, and fills transcripts and summaries.',
canReadAllObjectRecords: false,
canUpdateAllObjectRecords: false,
canSoftDeleteAllObjectRecords: false,
@@ -25,7 +25,7 @@ export default defineApplicationRole({
objectUniversalIdentifier:
STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.calendarEvent.universalIdentifier,
canReadObjectRecords: true,
- canUpdateObjectRecords: false,
+ canUpdateObjectRecords: true,
canSoftDeleteObjectRecords: false,
canDestroyObjectRecords: false,
},