From de75e507b6244875cfe7155c744541061003378d Mon Sep 17 00:00:00 2001 From: romit Date: Fri, 8 Aug 2025 00:29:13 +0530 Subject: [PATCH 1/3] fix --- .../ee/workflows/lib/getiCalEventAsString.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/features/ee/workflows/lib/getiCalEventAsString.ts b/packages/features/ee/workflows/lib/getiCalEventAsString.ts index 3d9b5a9385026e..6fb308c0fc2662 100644 --- a/packages/features/ee/workflows/lib/getiCalEventAsString.ts +++ b/packages/features/ee/workflows/lib/getiCalEventAsString.ts @@ -6,6 +6,7 @@ import { v4 as uuidv4 } from "uuid"; import dayjs from "@calcom/dayjs"; import { parseRecurringEvent } from "@calcom/lib/isRecurringEvent"; import type { Prisma, User } from "@calcom/prisma/client"; +import { bookingMetadataSchema } from "@calcom/prisma/zod-utils"; type Booking = Prisma.BookingGetPayload<{ include: { @@ -15,7 +16,7 @@ type Booking = Prisma.BookingGetPayload<{ }>; export function getiCalEventAsString( - booking: Pick & { + booking: Pick & { eventType: { recurringEvent?: Prisma.JsonValue; title?: string } | null; user: Partial | null; } @@ -28,6 +29,13 @@ export function getiCalEventAsString( const uid = uuidv4(); + let location = booking.location || ""; + + const videoCallUrl = bookingMetadataSchema.parse(booking.metadata || {})?.videoCallUrl; + if (videoCallUrl) { + location = videoCallUrl; + } + const icsEvent = createEvent({ uid, startInputType: "utc", @@ -44,7 +52,7 @@ export function getiCalEventAsString( }, title: booking.eventType?.title || "", description: booking.description || "", - location: booking.location || "", + location, organizer: { email: booking.user?.email || "", name: booking.user?.name || "", From 83c64487842f4b2c4e905bee8c02e0990e4e2b8b Mon Sep 17 00:00:00 2001 From: romit Date: Fri, 8 Aug 2025 00:56:36 +0530 Subject: [PATCH 2/3] fix --- .../ee/workflows/lib/getiCalEventAsString.ts | 12 ++---------- .../workflows/lib/reminders/emailReminderManager.ts | 2 ++ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/features/ee/workflows/lib/getiCalEventAsString.ts b/packages/features/ee/workflows/lib/getiCalEventAsString.ts index 6fb308c0fc2662..3d9b5a9385026e 100644 --- a/packages/features/ee/workflows/lib/getiCalEventAsString.ts +++ b/packages/features/ee/workflows/lib/getiCalEventAsString.ts @@ -6,7 +6,6 @@ import { v4 as uuidv4 } from "uuid"; import dayjs from "@calcom/dayjs"; import { parseRecurringEvent } from "@calcom/lib/isRecurringEvent"; import type { Prisma, User } from "@calcom/prisma/client"; -import { bookingMetadataSchema } from "@calcom/prisma/zod-utils"; type Booking = Prisma.BookingGetPayload<{ include: { @@ -16,7 +15,7 @@ type Booking = Prisma.BookingGetPayload<{ }>; export function getiCalEventAsString( - booking: Pick & { + booking: Pick & { eventType: { recurringEvent?: Prisma.JsonValue; title?: string } | null; user: Partial | null; } @@ -29,13 +28,6 @@ export function getiCalEventAsString( const uid = uuidv4(); - let location = booking.location || ""; - - const videoCallUrl = bookingMetadataSchema.parse(booking.metadata || {})?.videoCallUrl; - if (videoCallUrl) { - location = videoCallUrl; - } - const icsEvent = createEvent({ uid, startInputType: "utc", @@ -52,7 +44,7 @@ export function getiCalEventAsString( }, title: booking.eventType?.title || "", description: booking.description || "", - location, + location: booking.location || "", organizer: { email: booking.user?.email || "", name: booking.user?.name || "", diff --git a/packages/features/ee/workflows/lib/reminders/emailReminderManager.ts b/packages/features/ee/workflows/lib/reminders/emailReminderManager.ts index 5620cdaeec6e3d..42a86a5f5fa9ab 100644 --- a/packages/features/ee/workflows/lib/reminders/emailReminderManager.ts +++ b/packages/features/ee/workflows/lib/reminders/emailReminderManager.ts @@ -245,6 +245,8 @@ export const scheduleEmailReminder = async (args: scheduleEmailReminderArgs) => type: evt.eventType?.slug || "", organizer: { ...evt.organizer, language: { ...evt.organizer.language, translate: organizerT } }, attendees: [attendee], + // Resolve video call URL from metadata, similar to scheduleEmailReminders.ts line 334 + location: bookingMetadataSchema.parse(evt.metadata || {})?.videoCallUrl || evt.location, }; const attachments = includeCalendarEvent From c79892d93d932c2c668a605f6b89741828f77639 Mon Sep 17 00:00:00 2001 From: romit Date: Fri, 8 Aug 2025 01:03:31 +0530 Subject: [PATCH 3/3] chore --- .../features/ee/workflows/lib/reminders/emailReminderManager.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/features/ee/workflows/lib/reminders/emailReminderManager.ts b/packages/features/ee/workflows/lib/reminders/emailReminderManager.ts index 42a86a5f5fa9ab..84ae208d5fc418 100644 --- a/packages/features/ee/workflows/lib/reminders/emailReminderManager.ts +++ b/packages/features/ee/workflows/lib/reminders/emailReminderManager.ts @@ -245,7 +245,6 @@ export const scheduleEmailReminder = async (args: scheduleEmailReminderArgs) => type: evt.eventType?.slug || "", organizer: { ...evt.organizer, language: { ...evt.organizer.language, translate: organizerT } }, attendees: [attendee], - // Resolve video call URL from metadata, similar to scheduleEmailReminders.ts line 334 location: bookingMetadataSchema.parse(evt.metadata || {})?.videoCallUrl || evt.location, };