Skip to content

fix: Make BOOKING_CANCELLED` webhook payload consistent for regular cancellation and request-reschedule flow#26782

Merged
alishaz-polymath merged 3 commits intomainfrom
fix/missing-webhook-fields-req-reschedule
Jan 13, 2026
Merged

fix: Make BOOKING_CANCELLED` webhook payload consistent for regular cancellation and request-reschedule flow#26782
alishaz-polymath merged 3 commits intomainfrom
fix/missing-webhook-fields-req-reschedule

Conversation

@alishaz-polymath
Copy link
Member

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

  • 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

@alishaz-polymath alishaz-polymath requested a review from a team as a code owner January 13, 2026 07:05
@graphite-app graphite-app bot requested a review from a team January 13, 2026 07:05
@graphite-app graphite-app bot added core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO labels Jan 13, 2026
@alishaz-polymath alishaz-polymath enabled auto-merge (squash) January 13, 2026 07:07
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.

1 issue found across 11 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts">

<violation number="1" location="packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts:280">
P2: `bookingToReschedule.iCalSequence` is never selected from the repository, so this line always computes `NaN`, causing the webhook to emit an invalid iCal sequence.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@github-actions
Copy link
Contributor

Devin AI is addressing Cubic AI's review feedback

A Devin session has been created to address the issues identified by Cubic AI.

View Devin Session

@devin-ai-integration
Copy link
Contributor

Reviewed the Cubic AI feedback regarding the iCalSequence issue at line 280.

The confidence score for this issue is 8/10 (found in the comment metadata), which is below the required threshold of 9/10 for automated fixes. Per the review guidelines, I'm skipping this issue.

If you'd like me to investigate and fix this issue regardless of the confidence score, please let me know.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Jan 13, 2026
@vercel vercel bot temporarily deployed to Preview – cal-companion January 13, 2026 10:35 Inactive
@vercel vercel bot temporarily deployed to Preview – dev January 13, 2026 10:36 Inactive
Copy link
Member

@hariombalhara hariombalhara left a comment

Choose a reason for hiding this comment

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

LGTM !!

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

Labels

core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO ready-for-e2e size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants