cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

Booking Cancelled Webhook - Organiser webhook payload is missing id.

Open Shpadoinkle opened this issue 2 months ago • 3 comments

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 id for the organizer object

Shpadoinkle avatar Apr 22 '24 05:04 Shpadoinkle

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


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.

dosubot[bot] avatar Apr 22 '24 06:04 dosubot[bot]

@alishaz-polymath @Shpadoinkle Should we include the username in the organizer object as well?

vikaspatil0021 avatar Apr 25 '24 07:04 vikaspatil0021

@alishaz-polymath @Shpadoinkle Should we include the username in the organizer object as well?

Yes, that should be fine!

alishaz-polymath avatar Apr 25 '24 09:04 alishaz-polymath