cal.com
cal.com copied to clipboard
Booking Cancelled Webhook - Organiser webhook payload is missing id.
Issue Summary
Booking Created and Booking Rescheduled webhooks contain the id param on the organiser object.
But this is missing from the Booking Cancelled webhook.
Steps to Reproduce
cancel a booking. The organiser object is missing the id information that is available on the Created and Rescheduled webhook payloads.
Actual Results
- missing
id
Expected Results
- organiser object to be consistent with create/reschedule flows
Technical details
4.0.1
Evidence
- file
packages/features/bookings/lib/handleCancelBooking.ts - line 257 is not passing in
idfor theorganizerobject
The absence of the id parameter from the organiser object in the Booking Cancelled webhook payload is due to its omission in the construction of the organiser object within the handleCancelBooking.ts file. Unlike the Booking Created and Booking Rescheduled webhooks, where the id is included, the code for handling booking cancellations does not explicitly include the id in the organiser object.
To address this inconsistency, you would need to modify the section of the code that constructs the organiser object for the Booking Cancelled webhook payload to include the id. This involves adjusting the payload construction in the handleCancelBooking.ts file, specifically where the organiser details are set for the webhook payload.
For reference, the current construction of the organiser object for cancellations does not account for the id, focusing instead on properties like email, name, timeZone, timeFormat, and language. This is why the id parameter is present in the payloads for created and rescheduled bookings but missing from the cancelled booking webhook payload.
If you're looking to make the organiser object consistent across all booking-related webhooks, adding the id to the payload for cancellations would be the necessary step. This change would ensure that the organiser object structure remains uniform across different types of booking webhooks, facilitating a more predictable and reliable data format for webhook consumers.
Details
Sources
- packages/features/bookings/lib/handleCancelBooking.ts
- packages/features/bookings/lib/handleNewBooking/test/reschedule.test.ts
- apps/web/playwright/integrations.e2e.ts-snapshots/webhookResponse--calcom-web.txt
About Dosu This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
To continue the conversation, mention @dosu.
@alishaz-polymath @Shpadoinkle
Should we include the username in the organizer object as well?
@alishaz-polymath @Shpadoinkle Should we include the
usernamein theorganizerobject as well?
Yes, that should be fine!