Skip to content

fix(webhooks): add rescheduleRequested field to BOOKING_CANCELLED payload for host reschedule path#28880

Draft
paulonasc wants to merge 1 commit intocalcom:mainfrom
paulonasc:invented-anger
Draft

fix(webhooks): add rescheduleRequested field to BOOKING_CANCELLED payload for host reschedule path#28880
paulonasc wants to merge 1 commit intocalcom:mainfrom
paulonasc:invented-anger

Conversation

@paulonasc
Copy link
Copy Markdown

Summary

Fixes #28543

Webhook consumers (Zapier, Make, n8n) cannot distinguish a host "Request Reschedule" action from a genuine permanent cancellation — both fire identical BOOKING_CANCELLED payloads with rescheduledToUid: null, causing automations to incorrectly trigger refunds and CRM updates.

  • Adds an optional rescheduleRequested: boolean field to EventPayloadType (additive, backward-compatible)
  • Sets rescheduleRequested: false in the genuine-cancellation path (handleCancelBooking.ts)
  • Sets rescheduleRequested: true in the host-reschedule path (requestReschedule.handler.ts) — where the booking is cancelled so the attendee can pick a new slot

Changes

File Change
packages/features/webhooks/lib/sendPayload.ts Add rescheduleRequested?: boolean to EventPayloadType
packages/features/bookings/lib/handleCancelBooking.ts Set rescheduleRequested: false in genuine-cancellation webhook payload
packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts Set rescheduleRequested: true in host-reschedule webhook payload
packages/features/bookings/lib/handleCancelBooking/test/rescheduleRequested.test.ts New unit tests for both paths

Test plan

  • Genuine handleCancelBooking path fires BOOKING_CANCELLED with rescheduleRequested: false
  • Host "Request Reschedule" path fires BOOKING_CANCELLED with rescheduleRequested: true
  • Existing requestReschedule: true field is preserved for backward compatibility
  • No existing webhook consumer breaks (field is additive / optional)
  • Unit tests in rescheduleRequested.test.ts pass

🤖 Generated with Claude Code

…load for host reschedule path

Webhook consumers (Zapier, Make, n8n) could not distinguish a host
"Request Reschedule" action from a genuine permanent cancellation because
both paths fired identical BOOKING_CANCELLED payloads with rescheduledToUid: null.

- Add optional `rescheduleRequested: boolean` to `EventPayloadType` in sendPayload.ts
- Set `rescheduleRequested: false` in handleCancelBooking.ts (genuine cancellations)
- Set `rescheduleRequested: true` in requestReschedule.handler.ts (host reschedule requests)
- Add unit tests covering both paths

Fixes: calcom#28543

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the 🐛 bug Something isn't working label Apr 14, 2026
@CLAassistant
Copy link
Copy Markdown

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.


Paulo Nascimento 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.

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

Labels

🐛 bug Something isn't working size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: rescheduledToUid Is null in BOOKING_CANCELLED Webhook When Triggered via "Request Reschedule"

2 participants