-
Notifications
You must be signed in to change notification settings - Fork 10.2k
fix: Missing bookingId in BOOKING_CANCELLED webhook payload #22713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughA new TypeScript module, Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
packages/lib/server/service/BookingWebhookFactory.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-playwright". (The package "eslint-plugin-playwright" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-playwright" was referenced from the config file in ".eslintrc.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details:
|
|
||
const webhookFactory = new BookingWebhookFactory(); | ||
const payload = webhookFactory.createCancelledEventPayload({ | ||
bookingId: bookingToReschedule.id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing bookingId
bookingId: number; | ||
title: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made many properties required here
destinationCalendar: bookingToReschedule?.destinationCalendar | ||
? [bookingToReschedule?.destinationCalendar] | ||
: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This normalization of payload done in factory
@@ -276,39 +276,46 @@ export const requestRescheduleHandler = async ({ ctx, input }: RequestReschedule | |||
eventType?.metadata as EventTypeMetadata | |||
); | |||
|
|||
const evt: CalendarEvent = { | |||
title: bookingToReschedule?.title, | |||
type: event && event.slug ? event.slug : bookingToReschedule.title, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This normalization is also taken care of by by the factory
1ad74a9
to
3364c62
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (07/24/25)1 reviewer was added to this PR based on Keith Williams's automation. |
05e781e
to
378b5bc
Compare
edbaf48
to
393668c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome implementation of the factory and webhook contains bookingId
E2E results are ready! |
What does this PR do?
Now, we are sending bookingId from request-reschedule flow as well and building the payload at a central place that other places should use.
Tech Debt Cleanup
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Request Reschedule of a booking sends BOOKING_CANCELLED without bookingId in main branch