Fixes #16378

/claim #16378

Summary

  • When rescheduling a booking, the system now checks attendees’ (guests’) existing bookings
  • Time slots where guests have accepted bookings are filtered out from available slots
  • Prevents double-booking guests when hosts reschedule

How it works

  1. On reschedule, fetch the booking’s attendees
  2. Filter out host emails, keeping only guest emails
  3. Look up Cal.com users matching guest emails (primary + verified secondary)
  4. Query their accepted bookings in the date range
  5. Inject as busy times into the availability calculation

Key decisions

  • Only active during reschedule (not new bookings) — guests accept availability when first booking
  • Excluded for COLLECTIVE scheduling type (all hosts already checked)
  • Graceful degradation: errors return empty array, never block rescheduling
  • Uses existing repository pattern with Prisma select (no include)

Demo

https://github.com/user-attachments/assets/d23adabb-2cf4-4e69-841a-32911c8b2b8a

Files changed

  • UserRepository.ts — new findUsersByEmails method
  • BookingRepository.ts — new findAcceptedBookingsByUserIdsOrEmails method
  • getUserAvailability.ts — add guestBusyTimes to type + merge into busy times
  • slots/util.ts — new getGuestBusyTimesForReschedule function + call site

Test plan

  • Unit tests for UserRepository.findUsersByEmails (3 tests)
  • Unit tests for BookingRepository.findAcceptedBookingsByUserIdsOrEmails (5 tests)
  • Unit tests for getGuestBusyTimesForReschedule (8 tests)
  • All 19 tests passing
  • Type check passes
  • Biome lint passes

Claim

Total prize pool $200
Total paid $0
Status Pending
Submitted February 06, 2026
Last updated February 06, 2026

Contributors

DM

Dmitrii Malakhov

@malakhov-dmitrii

100%

Sponsors

CA

Cal.com, Inc.

@cal

$200