Skip to content

Scheduling infrastructure for absolutely everyone.

fix: clear videoCallData and iCalUID when organizer changes in round-robin reassignment (#24474)

chauhan_s9afdb1ad7ee3
diff --git a/packages/features/ee/round-robin/roundRobinManualReassignment.ts b/packages/features/ee/round-robin/roundRobinManualReassignment.ts
index 4502552324d..ff07e155e18 100644
--- a/packages/features/ee/round-robin/roundRobinManualReassignment.ts
+++ b/packages/features/ee/round-robin/roundRobinManualReassignment.ts
@@ -1,4 +1,4 @@
-// eslint-disable-next-line no-restricted-imports
+
import { cloneDeep } from "lodash";
import { enrichUserWithDelegationCredentialsIncludeServiceAccountKey } from "@calcom/app-store/delegationCredential";
@@ -312,6 +312,13 @@ export const roundRobinManualReassignment = async ({
conferenceCredentialId: conferenceCredentialId ?? undefined,
};
+ if( hasOrganizerChanged ){
+ // location might changed and will be new created in eventManager.create (organizer default location)
+ evt.videoCallData = undefined;
+ // To prevent "The requested identifier already exists" error while updating event, we need to remove iCalUID
+ evt.iCalUID = undefined;
+ }
+
const credentials = await prisma.credential.findMany({
where: { userId: newUser.id },
include: { user: { select: { email: true } } },
diff --git a/packages/features/ee/round-robin/roundRobinReassignment.ts b/packages/features/ee/round-robin/roundRobinReassignment.ts
index af5eaa304d5..08255c4ab1a 100644
--- a/packages/features/ee/round-robin/roundRobinReassignment.ts
+++ b/packages/features/ee/round-robin/roundRobinReassignment.ts
@@ -1,4 +1,4 @@
-// eslint-disable-next-line no-restricted-imports
+
import { cloneDeep } from "lodash";
import {
@@ -341,6 +341,12 @@ export const roundRobinReassignment = async ({
...(platformClientParams ? platformClientParams : {}),
};
+ if(hasOrganizerChanged){
+ // location might changed and will be new created in eventManager.create (organizer default location)
+ evt.videoCallData = undefined;
+ // To prevent "The requested identifier already exists" error while updating event, we need to remove iCalUID
+ evt.iCalUID = undefined;
+ }
const credentials = await prisma.credential.findMany({
where: {
userId: organizer.id,