/claim #16378
When a host reschedules a booking, the system now checks whether attendees are Cal.com users and fetches their busy times. Only mutually available slots are shown in the reschedule calendar.
Before: Host could freely pick any time when rescheduling, even if the guest was busy. After: Guest’s existing bookings are fetched and blocked automatically.
BookingRepository.findByUidIncludeAttendeeEmails() — gets attendee emails from the original bookingUserRepository.findByEmails() — resolves emails to Cal.com users (primary + verified secondary emails, case-insensitive, deduplicated via Promise.all)BookingRepository.findByUserIdsAndDateRange() — fetches guest bookings in the date range, with excludeUid filtering at the database levelPer @CarinaWolli’s clarification: this applies only when the event type owner reschedules. If attendees reschedule, all slots are shown.
[] on failure, never blocks rescheduling)30 tests passing (3 new test files, 631 lines added):
UserRepository.findByEmails — primary/secondary email lookup, dedup, normalization (6 tests)BookingRepository.findByUserIdsAndDateRange — userId/email query, excludeUid, empty input (6 tests)BookingRepository.findByUidIncludeAttendeeEmails — uid lookup, null handling (2 tests)_getGuestBusyTimesForReschedule — early exits, busy time collection, multi-guest, error handling (13 tests)select (not include) per cal.com conventionswithReporting wrapper for observabilityPromise.all for zero added latencyexcludeUid filtering at database level (not JS post-filter)Bcornish
@bcornish1797
Cal.com, Inc.
@cal