Skip to content

Commit 9afdb1a

Browse files
ibex088anikdhabal
andauthored
fix: clear videoCallData and iCalUID when organizer changes in round-robin reassignment (calcom#24474)
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
1 parent 78c2a69 commit 9afdb1a

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

packages/features/ee/round-robin/roundRobinManualReassignment.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// eslint-disable-next-line no-restricted-imports
1+
22
import { cloneDeep } from "lodash";
33

44
import { enrichUserWithDelegationCredentialsIncludeServiceAccountKey } from "@calcom/app-store/delegationCredential";
@@ -312,6 +312,13 @@ export const roundRobinManualReassignment = async ({
312312
conferenceCredentialId: conferenceCredentialId ?? undefined,
313313
};
314314

315+
if( hasOrganizerChanged ){
316+
// location might changed and will be new created in eventManager.create (organizer default location)
317+
evt.videoCallData = undefined;
318+
// To prevent "The requested identifier already exists" error while updating event, we need to remove iCalUID
319+
evt.iCalUID = undefined;
320+
}
321+
315322
const credentials = await prisma.credential.findMany({
316323
where: { userId: newUser.id },
317324
include: { user: { select: { email: true } } },

packages/features/ee/round-robin/roundRobinReassignment.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// eslint-disable-next-line no-restricted-imports
1+
22
import { cloneDeep } from "lodash";
33

44
import {
@@ -341,6 +341,12 @@ export const roundRobinReassignment = async ({
341341
...(platformClientParams ? platformClientParams : {}),
342342
};
343343

344+
if(hasOrganizerChanged){
345+
// location might changed and will be new created in eventManager.create (organizer default location)
346+
evt.videoCallData = undefined;
347+
// To prevent "The requested identifier already exists" error while updating event, we need to remove iCalUID
348+
evt.iCalUID = undefined;
349+
}
344350
const credentials = await prisma.credential.findMany({
345351
where: {
346352
userId: organizer.id,

0 commit comments

Comments
 (0)