Skip to content

fix: rollback booking when all calendar integrations fail - #4

Open
deepshekhardas wants to merge 2 commits into
mainfrom
fix/calendar-sync-rollback-28397
Open

deepshekhardas wants to merge 2 commits into
mainfrom
fix/calendar-sync-rollback-28397

Conversation

@deepshekhardas

@deepshekhardas deepshekhardas commented May 11, 2026

Copy link
Copy Markdown
Owner

When all calendar integrations (Google Calendar, Outlook, etc.) fail to create events, the booking is now rolled back and cancelled instead of being left as ACCEPTED with no calendar event. This prevents data inconsistency where bookings appear confirmed but have no corresponding calendar event.

Changes

  • Added rollback logic for new bookings when all calendar creation fails
  • Added rollback logic for rescheduling when all calendar updates fail
  • Updated error messages to be more user-friendly

The Bug

Previously, when calendar sync failed (due to API timeout, invalid token, rate limit), the booking would be saved as ACCEPTED in the database but no calendar event would be created. This led to:

  • Confirmed bookings without calendar events
  • Data inconsistency
  • User confusion

The Fix

When ALL calendar integrations fail:

  1. Booking status is updated to CANCELLED
  2. Cancellation reason is set: "Calendar sync failed - booking rolled back"
  3. User receives a clear error message

Note: Partial failures (some calendars succeed, some fail) are still logged but not rolled back, as at least some calendars have the event.

Closes calcom#28397


Summary by cubic

Rolls back and cancels bookings when all calendar integrations fail, preventing confirmed bookings without calendar events (Linear calcom#28397). Also adds a minimum cancellation notice setting with UI and validation.

  • New Features

    • Added minimum cancellation notice to event types, with a new Advanced tab controller.
    • Enforced notice on server and client: hide/disable cancel and block API if within notice.
    • Introduced user-friendly messages when cancellation is blocked.
  • Bug Fixes

    • New booking: if all calendar event creations fail, cancel the booking and set a clear cancellation reason.
    • Reschedule: if all calendar updates fail, cancel the booking and return an error.
    • Partial failures are logged only; no rollback when at least one integration succeeds.

Written for commit 369501f. Summary will update on new commits.

deepshekhardas added 2 commits May 11, 2026 14:38
- Add minimumCancellationNotice field to EventType model and types
- Create DisableCancellingController component with UI for setting notice period
- Add server-side validation in handleCancelBooking
- Add client-side validation in booking actions and booking details page
- Add isWithinMinimumCancellationNotice utility function

Closes calcom#15647
When all calendar integrations (Google Calendar, Outlook, etc.) fail to create
events, the booking is now rolled back and cancelled instead of being left
as ACCEPTED with no calendar event. This prevents data inconsistency where
bookings appear confirmed but have no corresponding calendar event.

- Added rollback logic for new bookings when all calendar creation fails
- Added rollback logic for rescheduling when all calendar updates fail
- Updated error messages to be more user-friendly

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Booking Saved Without Calendar Event on External Sync Failure – Missing Atomicity / Rollback

1 participant