Scheduling infrastructure for absolutely everyone.
fix: add check for cal video (#19020)
Udit Takkar82b1e681de7d
diff --git a/packages/features/bookings/lib/handleConfirmation.ts b/packages/features/bookings/lib/handleConfirmation.tsindex 15b9d5b983c..24a59a20985 100644--- a/packages/features/bookings/lib/handleConfirmation.ts+++ b/packages/features/bookings/lib/handleConfirmation.ts@@ -67,6 +67,7 @@ export async function handleConfirmation(args: {eventTypeId: number | null;smsReminderNumber: string | null;userId: number | null;+ location: string | null;};paid?: boolean;emailsEnabled?: boolean;@@ -441,6 +442,7 @@ export async function handleConfirmation(args: {booking: {startTime: booking.startTime,id: booking.id,+ location: booking.location,},triggerForUser,organizerUser: { id: booking.userId },diff --git a/packages/features/bookings/lib/handleNewBooking.ts b/packages/features/bookings/lib/handleNewBooking.tsindex 3d0fde73fd3..a30ad16c143 100644--- a/packages/features/bookings/lib/handleNewBooking.ts+++ b/packages/features/bookings/lib/handleNewBooking.ts@@ -12,7 +12,6 @@ import {MeetLocationType,OrganizerDefaultConferencingAppType,} from "@calcom/app-store/locations";-import { DailyLocationType } from "@calcom/app-store/locations";import { getAppFromSlug } from "@calcom/app-store/utils";import EventManager from "@calcom/core/EventManager";import { getEventName } from "@calcom/core/event";@@ -1983,9 +1982,9 @@ async function handler(}try {- if (isConfirmedByDefault && (booking.location === DailyLocationType || booking.location?.trim() === "")) {+ if (isConfirmedByDefault) {await monitorCallbackAsync(scheduleNoShowTriggers, {- booking: { startTime: booking.startTime, id: booking.id },+ booking: { startTime: booking.startTime, id: booking.id, location: booking.location },triggerForUser,organizerUser: { id: organizerUser.id },eventTypeId,diff --git a/packages/features/bookings/lib/handleNewBooking/scheduleNoShowTriggers.ts b/packages/features/bookings/lib/handleNewBooking/scheduleNoShowTriggers.tsindex a716c56a8ee..3b91dc473c5 100644--- a/packages/features/bookings/lib/handleNewBooking/scheduleNoShowTriggers.ts+++ b/packages/features/bookings/lib/handleNewBooking/scheduleNoShowTriggers.ts@@ -1,3 +1,4 @@+import { DailyLocationType } from "@calcom/app-store/locations";import dayjs from "@calcom/dayjs";import tasker from "@calcom/features/tasker";import getWebhooks from "@calcom/features/webhooks/lib/getWebhooks";@@ -7,6 +8,7 @@ type ScheduleNoShowTriggersArgs = {booking: {startTime: Date;id: number;+ location: string | null;};triggerForUser?: number | true | null;organizerUser: { id: number | null };@@ -29,7 +31,9 @@ export const scheduleNoShowTriggers = async (args: ScheduleNoShowTriggersArgs) =isDryRun = false,} = args;- if (isDryRun) return;+ const isCalVideoLocation = booking.location === DailyLocationType || booking.location?.trim() === "";++ if (isDryRun || !isCalVideoLocation) return;// Add task for automatic no show in cal videoconst noShowPromises: Promise<any>[] = [];