What does this PR do?

When a host reschedules a booking, the system now checks if any guest (attendee/booker) is a registered Cal.com user. If they are, their existing bookings are fetched and used to filter out time slots that conflict with their schedule — ensuring only mutually available slots are shown.

Changes

BookingRepository.ts — Added findAcceptedBookingsByUserIdInDateRange():

  • Queries accepted bookings where the user is either host (userId) or attendee (email)
  • Deduplicates results from both queries
  • Supports excluding the booking being rescheduled (excludeUid)

AvailableSlotsService (util.ts) — Added guest availability filtering in _getAvailableSlots:

  1. When rescheduleUid is present, fetches the booking being rescheduled
  2. For each attendee, checks if they’re a registered Cal.com user via userRepo.findByEmail
  3. For Cal.com attendees, fetches their accepted bookings in the requested date range
  4. Filters available time slots using checkForConflicts to remove slots where guests are busy

How it works

  • Non-Cal.com guests are completely unaffected (no availability check performed)
  • The booking being rescheduled is excluded from busy time calculations
  • Uses the existing checkForConflicts utility for consistent conflict detection

Fixes #16378

/claim #16378

Claim

Total prize pool $200
Total paid $0
Status Pending
Submitted March 20, 2026
Last updated March 20, 2026

Contributors

يو

يوسف جمال يوسف محمد ناجي

@promisingcoder

100%

Sponsors

CA

Cal.com, Inc.

@cal

$200