Scheduling infrastructure for absolutely everyone.
fix: attendess are not showing (#23255)
Anik Dhabal Babu866b6cc23315
diff --git a/packages/app-store/googlecalendar/lib/CalendarService.ts b/packages/app-store/googlecalendar/lib/CalendarService.tsindex 90c96113ad3..28331cccef9 100644--- a/packages/app-store/googlecalendar/lib/CalendarService.ts+++ b/packages/app-store/googlecalendar/lib/CalendarService.ts@@ -10,6 +10,7 @@ import type { FreeBusyArgs } from "@calcom/features/calendar-cache/calendar-cachimport { getTimeMax, getTimeMin } from "@calcom/features/calendar-cache/lib/datesForCache";import { getLocation, getRichDescription } from "@calcom/lib/CalEventParser";import { uniqueBy } from "@calcom/lib/array";+import { ORGANIZER_EMAIL_EXEMPT_DOMAINS } from "@calcom/lib/constants";import logger from "@calcom/lib/logger";import { safeStringify } from "@calcom/lib/safeStringify";import { SelectedCalendarRepository } from "@calcom/lib/server/repository/selectedCalendar";@@ -85,10 +86,16 @@ export default class GoogleCalendarService implements Calendar {const selectedHostDestinationCalendar = event.destinationCalendar?.find((cal) => cal.credentialId === this.credential.id);++ const isOrganizerExempt = ORGANIZER_EMAIL_EXEMPT_DOMAINS?.split(",")+ .filter((domain) => domain.trim() !== "")+ .some((domain) => event.organizer.email.toLowerCase().endsWith(domain.toLowerCase()));+const eventAttendees = event.attendees.map(({ id: _id, ...rest }) => ({...rest,responseStatus: "accepted",}));+const attendees: calendar_v3.Schema$EventAttendee[] = [{...event.organizer,@@ -100,7 +107,7 @@ export default class GoogleCalendarService implements Calendar {// We use || instead of ?? here to handle empty stringsemail: hostExternalCalendarId || selectedHostDestinationCalendar?.externalId || event.organizer.email,},- ...eventAttendees,+ ...(event.hideOrganizerEmail && !isOrganizerExempt ? [] : eventAttendees),];if (event.team?.members) {diff --git a/packages/lib/CalendarManager.ts b/packages/lib/CalendarManager.tsindex 8d29874a3a4..76868fba4a4 100644--- a/packages/lib/CalendarManager.ts+++ b/packages/lib/CalendarManager.ts@@ -2,6 +2,7 @@import { sortBy } from "lodash";import { getCalendar } from "@calcom/app-store/_utils/getCalendar";+import { MeetLocationType } from "@calcom/app-store/locations";import getApps from "@calcom/app-store/utils";import dayjs from "@calcom/dayjs";import { getUid } from "@calcom/lib/CalEventParser";@@ -494,12 +495,14 @@ const processEvent = (calEvent: CalendarEvent): CalendarServiceEvent => {calendarDescription: getRichDescription(calEvent),};+ const isMeetLocationType = calEvent.location === MeetLocationType;+// Determine if the calendar event should include attendeesconst isOrganizerExempt = ORGANIZER_EMAIL_EXEMPT_DOMAINS?.split(",").filter((domain) => domain.trim() !== "").some((domain) => calEvent.organizer.email.toLowerCase().endsWith(domain.toLowerCase()));- if (calEvent.hideOrganizerEmail && !isOrganizerExempt) {+ if (calEvent.hideOrganizerEmail && !isOrganizerExempt && !isMeetLocationType) {calendarEvent.attendees = [];}