fix: archive meeting during host-change reschedules (#25098)

This commit is contained in:
Anik Dhabal Babu
2025-11-19 10:24:50 +00:00
committed by GitHub
parent 21411b8f93
commit 9f277c5179
3 changed files with 12 additions and 1 deletions
+10 -1
View File
@@ -123,6 +123,10 @@ export default class HubspotCalendarService implements CRM {
return this.hubspotClient.crm.objects.meetings.basicApi.update(uid, simplePublicObjectInput);
};
private hubspotArchiveMeeting = async (uid: string) => {
return this.hubspotClient.crm.objects.meetings.basicApi.archive(uid);
};
private hubspotAuth = async (credential: CredentialPayload) => {
const appKeys = await getAppKeysFromSlug("hubspot");
if (typeof appKeys.client_id === "string") this.client_id = appKeys.client_id;
@@ -212,9 +216,14 @@ export default class HubspotCalendarService implements CRM {
return await this.hubspotUpdateMeeting(uid, event);
}
async deleteEvent(uid: string): Promise<void> {
async deleteEvent(uid: string, event: CalendarEvent): Promise<void> {
const auth = await this.auth;
await auth.getToken();
if (event?.hasOrganizerChanged) {
await this.hubspotArchiveMeeting(uid);
return;
}
await this.hubspotCancelMeeting(uid);
}
@@ -1884,6 +1884,7 @@ async function handler(
evt.videoCallData = undefined;
// To prevent "The requested identifier already exists" error while updating event, we need to remove iCalUID
evt.iCalUID = undefined;
evt.hasOrganizerChanged = true;
}
if (changedOrganizer && originalRescheduledBooking?.user) {
+1
View File
@@ -222,6 +222,7 @@ export interface CalendarEvent {
domainWideDelegationCredentialId?: string | null;
customReplyToEmail?: string | null;
rescheduledBy?: string;
hasOrganizerChanged?: boolean;
}
export interface EntryPoint {