Skip to content

feat: check guest availability when rescheduling bookings#27960

Draft
omair445 wants to merge 3 commits intocalcom:mainfrom
omair445:feat/guest-availability-reschedule
Draft

feat: check guest availability when rescheduling bookings#27960
omair445 wants to merge 3 commits intocalcom:mainfrom
omair445:feat/guest-availability-reschedule

Conversation

@omair445
Copy link

ran into this a few times — when rescheduling a meeting, the new time slot only checks the host's availability but completely ignores whether the guests are free. ends up creating conflicts.

this adds guest availability checking during reschedule:

  • when a host reschedules, the system looks up guest Cal.com accounts
  • if a guest has a Cal.com account, their busy times are factored into available slots
  • if a guest doesn't have an account or the lookup fails, rescheduling proceeds normally (graceful degradation)

changes:

  • added repository method to look up users by email
  • new utility function to fetch and merge guest busy times
  • integrated into the availability calculation pipeline
  • no breaking changes — if anything goes wrong it falls back to current behavior

fixes #16378

When a host reschedules a booking, the system now checks if any
guests are Cal.com users and factors in their existing bookings
as busy times. This prevents double-booking guests who have
their own Cal.com accounts.

Implementation:
- Added UserRepository.findUsersByEmails() to look up Cal.com users
  by primary or verified secondary email addresses
- Added BookingRepository.findAcceptedBookingsByUserIdsOrEmails()
  to find conflicting bookings for guest users
- Added getGuestBusyTimesForReschedule() utility that orchestrates
  guest lookup → user resolution → booking conflict detection
- Integrated guest busy times into getUserAvailability via initialData
- Skipped for COLLECTIVE scheduling (hosts already have availability checked)

The feature degrades gracefully — if guest lookup fails, rescheduling
proceeds normally without guest availability constraints.

Fixes calcom#16378
@omair445 omair445 requested a review from a team as a code owner February 14, 2026 20:27
@CLAassistant
Copy link

CLAassistant commented Feb 14, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added $200 bookings area: bookings, availability, timezones, double booking Medium priority Created by Linear-GitHub Sync ✨ feature New feature or request 💎 Bounty A bounty on Algora.io 🧹 Improvements Improvements to existing features. Mostly UX/UI labels Feb 14, 2026
@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Feb 14, 2026
@graphite-app
Copy link

graphite-app bot commented Feb 14, 2026

Graphite Automations

"Send notification to Community team when bounty PR opened" took an action on this PR • (02/14/26)

2 teammates were notified to this PR based on Keith Williams's automation.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Copy link
Member

@romitg2 romitg2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add necessary tests, and provide video demo. Thank you!

@romitg2 romitg2 marked this pull request as draft February 15, 2026 05:56
@omair445
Copy link
Author

hey @romitg2, added tests for the guest availability logic! covers the main scenarios — guest lookup, busy time merging, graceful fallback when guests don't have cal accounts, edge cases like no guests/multiple guests, and error handling.

working on the demo video now, will have it up shortly 👍

@omair445
Copy link
Author

added tests for the rescheduling flow — covers the main scenarios (no attendees, host filtering, guest lookup, multiple guests, error handling, etc). video demo coming shortly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bookings area: bookings, availability, timezones, double booking 💎 Bounty A bounty on Algora.io community Created by Linear-GitHub Sync ✨ feature New feature or request 🧹 Improvements Improvements to existing features. Mostly UX/UI Medium priority Created by Linear-GitHub Sync size/L $200

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CAL-4531] Take into account guest's availability when rescheduling

3 participants