/claim #16378 Rather than post-filtering slots, this PR treats Cal.com guests as fixed hosts in the availability calculation pipeline, so the entire existing availability engine handles conflict detection natively including buffers, OOO periods, and calendar integrations
A second validation layer is also added at booking confirmation time to close any race condition between slot display and actual booking. Changes UserRepository.ts Added findManyByEmailsForAvailability():
Fetches all attendees in a single batch query (no N+1) Normalizes emails and supports secondary emails Only selects users with connected calendar credentials
availability.ts Added filterValidGuestUsers():
Shared utility to filter out guests who are also hosts (deduplication) Only includes guests with connected calendars
slots/util.ts Injects valid guest users as fixed hosts into the availability calculation so mutual availability is computed natively ensureAvailableUsers.ts Added confirmation-time validation to ensure guest availability is re-checked when the booking is actually confirmed Notes
Non-Cal.com guests and guests without connected calendars are gracefully skipped The booking being rescheduled is excluded from busy time calculations
BISHT.cx
@cherry-bisht
Cal.com, Inc.
@cal