Skip to content

feat(reschedule): check guest availability when host reschedules#28200

Closed
Kitress3 wants to merge 1 commit intocalcom:mainfrom
Kitress3:feat/guest-availability-reschedule
Closed

feat(reschedule): check guest availability when host reschedules#28200
Kitress3 wants to merge 1 commit intocalcom:mainfrom
Kitress3:feat/guest-availability-reschedule

Conversation

@Kitress3
Copy link

Summary

When a host reschedules a booking, the available slot picker now filters out time slots that conflict with the guests (non-host attendees) existing accepted bookings — preventing the host from accidentally double-booking a guest.

Changes

  1. BookingRepository.ts - Add getAcceptedBookingsByAttendeeEmails() to query bookings where any attendee is in a given email list
  2. slots/util.ts - In calculateHostsAndAvailabilities(): fetch guest busy times when rescheduleUid is present; pass via initialData.guestBusyTimes
  3. getUserAvailability.ts - Add guestBusyTimes? to GetUserAvailabilityInitialData; spread into detailedBusyTimes

How it works

  1. When rescheduleUid is present in getSchedule, look up the original booking attendees via BookingRepository
  2. Filter out host emails (booking user + event-type hosts) to isolate guest-only emails
  3. Query their accepted bookings in the slot search window, excluding the booking being rescheduled
  4. Pass these as guestBusyTimes through initialData into getUserAvailability, where they are merged into detailedBusyTimes

Fixes #16378
/claim #28164

- Add getAcceptedBookingsByAttendeeEmails() to BookingRepository
- Fetch guest bookings and filter out host emails in slots/util.ts
- Add guestBusyTimes to GetUserAvailabilityInitialData
- Merge guest busy times into detailedBusyTimes

Fixes calcom#16378
/claim calcom#28164
@Kitress3 Kitress3 requested a review from a team as a code owner February 27, 2026 05:52
@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Feb 27, 2026
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


OpenClaw Agent seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@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 27, 2026
@graphite-app
Copy link

graphite-app bot commented Feb 27, 2026

Graphite Automations

"Send notification to Community team when bounty PR opened" took an action on this PR • (02/27/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 3 files


Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

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.

Thanks @Kitress3 for PR, but since your PR lacks test coverage and also not visual demo is added, and we have already reviewed other open prs and chose the best one amongst them and will be going forward with this one: #27710

@romitg2 romitg2 closed this Feb 27, 2026
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 claim 💎 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