Skip to content

Code Review Bench PR #26782 - fix: Make BOOKING_CANCELLED` webhook payload consistent for regular cancellation and request-reschedule flow#11

Open
tomerqodo wants to merge 3 commits intobase_pr_26782_20260125_3527from
corrupted_pr_26782_20260125_3527
Open

Code Review Bench PR #26782 - fix: Make BOOKING_CANCELLED` webhook payload consistent for regular cancellation and request-reschedule flow#11
tomerqodo wants to merge 3 commits intobase_pr_26782_20260125_3527from
corrupted_pr_26782_20260125_3527

Conversation

@tomerqodo
Copy link

Code Review Bench PR calcom#26782

Original PR Title: fix: Make BOOKING_CANCELLED` webhook payload consistent for regular cancellation and request-reschedule flow
Original PR Description: ## What does this PR do?

Fixes inconsistencies in the BOOKING_CANCELLED webhook payload when triggered via the "Request Reschedule" flow vs regular cancellations.

Issues Fixed:

  1. Missing organizer.id - The usersToPeopleType() function in requestReschedule.handler.ts was not including the id field when converting users to Person objects, causing intermittent organizer.id missing errors for webhook consumers.

  2. Missing payload fields - The request reschedule cancellation webhook was missing several fields that are present in regular cancellation webhooks:

    • eventTypeId (Int)
    • length (Int)
    • iCalSequence (Int)
    • eventTitle (String)
    • status (String)
  3. New requestReschedule field - Added a new boolean field to help webhook consumers distinguish between:

    • Regular cancellations (requestReschedule: false)
    • Cancellations triggered by a reschedule request (requestReschedule: true)

Changes:

  • Updated requestReschedule.handler.ts to include id in organizer and pass additional fields
  • Updated BookingWebhookFactory.ts to support new cancellation payload fields
  • Updated handleCancelBooking.ts to include requestReschedule: false
  • Updated cancelAttendeeSeat.ts to include requestReschedule: false
  • Updated DI scaffolding (BookingWebhookService, BookingPayloadBuilder, DTOs, params)
  • Updated webhook documentation (webhooks.mdx)

Note: This is a non-breaking change - only adds new fields to existing payloads.

Visual Demo (For contributors especially)

Before (Request Reschedule cancellation webhook - missing fields):

{
  "triggerEvent": "BOOKING_CANCELLED",
  "payload": {
    "organizer": {
      // "id" was MISSING
      "email": "organizer@example.com",
      "name": "Organizer Name"
    }
    // Missing: eventTypeId, length, iCalSequence, eventTitle, status, requestReschedule
  }
}

After (Request Reschedule cancellation webhook - complete):

{
  "triggerEvent": "BOOKING_CANCELLED",
  "payload": {
    "organizer": {
      "id": 1,
      "email": "organizer@example.com",
      "name": "Organizer Name"
    },
    ... other fields
    "eventTypeId": 100,
    "length": 30,
    "iCalSequence": 2,
    "eventTitle": "Strategy Session",
    "status": "CANCELLED",
    "requestReschedule": true
  }
}

Regular cancellation webhook (now includes new field):

{
  "triggerEvent": "BOOKING_CANCELLED",
  "payload": {
    ... other fields
    "requestReschedule": false
  }
}

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. Updated docs/developing/guides/automation/webhooks.mdx and packages/features/webhooks/WEBHOOK_PAYLOADS.md.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

Test 1: Regular Cancellation

  1. Create a booking
  2. Cancel the booking as the host
  3. Check the webhook payload includes:
    • organizer.id is present
    • requestReschedule: false

Test 2: Request Reschedule Cancellation

  1. Create a booking
  2. As the host, click "Request Reschedule"
  3. Check the webhook payload includes:
    • organizer.id is present
    • eventTypeId, length, iCalSequence, eventTitle, status are all present
    • requestReschedule: true

Test 3: Seat Cancellation

  1. Create a seated event booking with multiple attendees
  2. Cancel one attendee's seat
  3. Check the webhook payload includes requestReschedule: false

Checklist

This was referenced Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants