Scheduling infrastructure for absolutely everyone.
fix: different calendar hosts (#24000)
chauhan_s52a5afeba506
diff --git a/packages/app-store/office365calendar/lib/CalendarService.ts b/packages/app-store/office365calendar/lib/CalendarService.tsindex 62219f87692..ba908b1a893 100644--- a/packages/app-store/office365calendar/lib/CalendarService.ts+++ b/packages/app-store/office365calendar/lib/CalendarService.ts@@ -481,7 +481,9 @@ export default class Office365CalendarService implements Calendar {.map((member) => {const destinationCalendar =event.destinationCalendar &&- event.destinationCalendar.find((cal) => cal.userId === member.id);+ event.destinationCalendar.find(+ (cal) => cal.integration === this.integrationName && cal.userId === member.id+ );return {emailAddress: {address: destinationCalendar?.externalId ?? member.email,diff --git a/packages/features/bookings/lib/handleNewBooking.ts b/packages/features/bookings/lib/handleNewBooking.tsindex 7f067f209a9..74f08daa95b 100644--- a/packages/features/bookings/lib/handleNewBooking.ts+++ b/packages/features/bookings/lib/handleNewBooking.ts@@ -1480,7 +1480,7 @@ async function handler(const changedOrganizer =!!originalRescheduledBooking &&- eventType.schedulingType === SchedulingType.ROUND_ROBIN &&+ (eventType.schedulingType === SchedulingType.ROUND_ROBIN || eventType.schedulingType === SchedulingType.COLLECTIVE) &&originalRescheduledBooking.userId !== evt.organizer.id;const skipDeleteEventsAndMeetings = changedOrganizer;diff --git a/packages/features/bookings/lib/handleNewBooking/test/team-bookings/collective-reschedule-destination-calendar.test.ts b/packages/features/bookings/lib/handleNewBooking/test/team-bookings/collective-reschedule-destination-calendar.test.tsindex c3cf1b3b94c..1a309971ac6 100644--- a/packages/features/bookings/lib/handleNewBooking/test/team-bookings/collective-reschedule-destination-calendar.test.ts+++ b/packages/features/bookings/lib/handleNewBooking/test/team-bookings/collective-reschedule-destination-calendar.test.ts@@ -138,11 +138,7 @@ describe("handleNewBooking", () => {status: BookingStatus.ACCEPTED,startTime: `${plus1DateString}T05:00:00.000Z`,endTime: `${plus1DateString}T05:30:00.000Z`,- users: [- {- id: 101, // organizer- },- ],+ userId: 101,references: [{type: appStoreMetadata.dailyvideo.type,diff --git a/packages/lib/formatCalendarEvent.ts b/packages/lib/formatCalendarEvent.tsindex a9e8482efe0..53d28cb7642 100644--- a/packages/lib/formatCalendarEvent.ts+++ b/packages/lib/formatCalendarEvent.ts@@ -17,10 +17,12 @@ const formatClientIdFromEmails = (calEvent: CalendarEvent | ExtendedCalendarEvenconst team = calEvent.team? {...calEvent.team,- members: calEvent.team.members.map((member) => ({- ...member,- email: member.email.replace(`+${clientId}`, ""),- })),+ members: calEvent.team.members.map((member) => {+ return {+ ...member,+ email: member.email.replace(`+${clientId}`, ""),+ };+ }),}: undefined;return [attendees, organizer, team];@@ -39,8 +41,8 @@ export const formatCalEvent = (calEvent: CalendarEvent) => {export const formatCalEventExtended = (calEvent: ExtendedCalendarEvent) => {const clonedEvent = cloneDeep(calEvent);if (clonedEvent.platformClientId) {- const [attendees, organizer] = formatClientIdFromEmails(clonedEvent, clonedEvent.platformClientId);- Object.assign(clonedEvent, { attendees, organizer });+ const [attendees, organizer, team] = formatClientIdFromEmails(clonedEvent, clonedEvent.platformClientId);+ Object.assign(clonedEvent, { attendees, organizer, team });}return clonedEvent;