Skip to content

Conversation

@Ryukemeister
Copy link
Contributor

@Ryukemeister Ryukemeister commented Jan 2, 2026

What does this PR do?

Fixes a bug where rescheduling a seated booking (triggered by the "Limit number of upcoming bookings per booker" option with reschedule offer) would reschedule all attendees instead of just the individual attendee who hit their booking limit.

Fixes - CAL7007

Root cause: When the BookerLimitExceededReschedule error was thrown, it didn't include the seatUid for the booker's seat. Without this, the reschedule was treated as an owner-level reschedule that moves all attendees.

Fix:

  1. Query the booker's bookingSeat.referenceUid when checking booking limits
  2. Include seatUid in the error data
  3. Use seatUid (when available) as the reschedule UID to trigger individual seat reschedule behavior

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. N/A - no documentation changes needed.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Create an event type with:

    • "Allow multiple seats" enabled
    • "Limit number of upcoming bookings per booker" set to 1
    • "Offer to reschedule the last booking to the new time slot" enabled
  2. Have User A book a seat on the event

  3. Have User B book a seat on the same time slot

  4. Have User A try to book another time slot

  5. User A should be offered to reschedule their previous booking

  6. Accept the reschedule offer

Expected: Only User A's seat moves to the new time slot. User B remains on the original booking.

Before fix: Both User A and User B would be moved to the new time slot.

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

Human Review Checklist

  • Verify that using seatUid as the reschedule UID correctly triggers individual seat reschedule (vs owner reschedule)
  • Verify the where: { email: bookerEmail } filter correctly gets only the booker's seat
  • Consider if automated tests should be added for this scenario - Test added in booking-validations.test.ts

Updates since last revision

  • Added unit test includes seatUid in reschedule error for seated events in booking-validations.test.ts that verifies:
    • When a booker hits their booking limit on a seated event with reschedule offer enabled
    • The error data includes both rescheduleUid (booking UID) and seatUid (seat reference UID)

Link to Devin run: https://app.devin.ai/sessions/a845a427bab44e0589b39126f7f0e8f6
Requested by: @Ryukemeister (rajiv@cal.com)

… error

Co-Authored-By: rajiv@cal.com <sahalrajiv6900@gmail.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vercel
Copy link

vercel bot commented Jan 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Review Updated (UTC)
cal Ignored Ignored Jan 4, 2026 10:13am
cal-companion Ignored Ignored Preview Jan 4, 2026 10:13am
cal-eu Ignored Ignored Jan 4, 2026 10:13am

@Ryukemeister Ryukemeister marked this pull request as ready for review January 2, 2026 11:09
@Ryukemeister Ryukemeister requested a review from a team as a code owner January 2, 2026 11:09
@graphite-app graphite-app bot added the consumer label Jan 2, 2026
@graphite-app graphite-app bot requested a review from a team January 2, 2026 11:09
@graphite-app graphite-app bot added the core area: core, team members only label Jan 2, 2026
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 2 files

… seated events

Co-Authored-By: rajiv@cal.com <sahalrajiv6900@gmail.com>
Copy link
Contributor

@hbjORbj hbjORbj left a comment

Choose a reason for hiding this comment

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

Seems safe and nice

Comment on lines +111 to +112
where: {
email: bookerEmail,
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason for adding this WHERE clause?

@github-actions github-actions bot marked this pull request as draft January 7, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

consumer core area: core, team members only ready-for-e2e size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants