What does this PR do?
This PR fixes a critical scheduling bug where attendee availability was not being checked during reschedule operations, leading to double-booking scenarios. When a Cal.com user books another Cal.com user and the host tries to reschedule, the system was only checking the host’s availability and ignoring attendee conflicts.
Bounty
The Problem:
- User A books User B for 2PM-3PM
- User B wants to reschedule to 3PM-4PM
- System only checks User B’s availability
- User A might be busy 3PM-4PM or not available on particular day ( Double-booking created! )
The Solution:
- Automatically detect Cal.com attendees during reschedule operations
- Include attendee availability in the core slot calculation system
- Block conflicting time slots from being offered
- Prevent double-booking scenarios entirely
Visual Demo (For contributors especially)
Before fix:
User A was unavailable on Wednesday, but User B (the host) was still able to reschedule to Wednesday.
https://github.com/user-attachments/assets/aa1f7078-9794-4996-a39f-aea975bc37fd
After fix:
User A was unavailable on Friday, so User B (the host) was not able to reschedule to Friday.
https://github.com/user-attachments/assets/50d77319-7065-40c3-8713-831cf52048f3
Mandatory Tasks (DO NOT REMOVE)
- I have self-reviewed the code (A decent size PR without self-review might be rejected).
- I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
- I confirm automated tests are in place that prove my fix is effective or that my feature works.
How should this be tested?
- Create two Cal.com users:
- Environment variables:
- No special environment variables required
- Standard Cal.com development setup
Checklist
- I have read the contributing guide
- My code follows the style guidelines of this project
- I have commented my code, particularly in hard-to-understand areas
- I have checked if my changes generate no new warnings