fix: revert assignmentReason breaking change in webhook payloads (#27891)
* fix: revert assignmentReason breaking change in webhook payloads
Remove the new { category, details } format from EventPayloadType to
maintain backward compatibility for webhook consumers. The new format
is stripped at all webhook payload construction sites by destructuring
assignmentReason out of CalendarEvent before spreading into the payload.
A sanitizeAssignmentReasonForWebhook function provides an additional
safety net in sendPayload itself. Emails and booking single view
continue to use the new format via CalendarEvent.
Co-Authored-By: ali@cal.com <alishahbaz7@gmail.com>
* fix: strip assignmentReason from handlePaymentSuccess webhook payload
Co-Authored-By: ali@cal.com <alishahbaz7@gmail.com>
* fix: strip assignmentReason from triggerWebhooks and handleSeats webhook payloads
Co-Authored-By: ali@cal.com <alishahbaz7@gmail.com>
* refactor: use zod safeParse instead of type assertion in sanitizeAssignmentReasonForWebhook
Co-Authored-By: ali@cal.com <alishahbaz7@gmail.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
ali@cal.com <alishahbaz7@gmail.com>
ali@cal.com <alishahbaz7@gmail.com>
ali@cal.com <alishahbaz7@gmail.com>
ali@cal.com <alishahbaz7@gmail.com>
Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent
21d28c9747
commit
3a7122d613
@@ -54,8 +54,9 @@ export const triggerRecordingReadyWebhook = async ({
|
||||
})
|
||||
);
|
||||
|
||||
const { assignmentReason: _emailAssignmentReason, ...evtWithoutAssignmentReason } = evt;
|
||||
const payload: EventPayloadType = {
|
||||
...evt,
|
||||
...evtWithoutAssignmentReason,
|
||||
downloadLink,
|
||||
};
|
||||
|
||||
@@ -94,8 +95,9 @@ export const triggerTranscriptionGeneratedWebhook = async ({
|
||||
})
|
||||
);
|
||||
|
||||
const { assignmentReason: _emailAssignmentReason2, ...evtWithoutAssignmentReason2 } = evt;
|
||||
const payload: EventPayloadType = {
|
||||
...evt,
|
||||
...evtWithoutAssignmentReason2,
|
||||
downloadLinks,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user