fix: restore attendeeSeatId to top-level webhook payload for backward compatibility#28528
Conversation
There was a problem hiding this comment.
2 issues found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/api/v2/src/modules/deployments/deployments.service.ts">
<violation number="1" location="apps/api/v2/src/modules/deployments/deployments.service.ts:11">
P1: Field rename from `status` to `valid` breaks backward compatibility with cached payloads and may cause license validation to fail for up to 24 hours. Add backward-compatible fallback logic to handle both field names during transition.</violation>
</file>
<file name="packages/features/bookings/lib/service/RegularBookingService.ts">
<violation number="1" location="packages/features/bookings/lib/service/RegularBookingService.ts:2478">
P2: The `attendeeSeatId` restoration in webhookData may not cover the BOOKING_REQUESTED async flow. The BOOKING_REQUESTED webhook uses `queueBookingRequestedWebhook()` which enqueues only identifiers (bookingUid, userId, etc.) for later payload construction. If the downstream consumer/builder wasn't also updated to include attendeeSeatId, pending booking webhooks will still be missing this field at the top level. Verify the consumer-side payload construction (likely in WebhookTaskerProducerService or BookingPayloadBuilder) also includes attendeeSeatId, or apply the same fix there.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
b97f658 to
c89a923
Compare
sahitya-chandra
left a comment
There was a problem hiding this comment.
Can you add a before and after video of the changes
|
Hi @sahitya-chandra, this is a pure backend/webhook payload change with no UI component, so a screen recording wouldn't capture the fix meaningfully. The change can be verified by:
The before/after is visible directly in the diff — the field was simply missing from the payload construction and has been restored for backward compatibility. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe PR adjusts webhook payload construction for bookings to conditionally include 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/features/bookings/lib/getWebhookPayloadForBooking.ts`:
- Around line 33-37: The spread references evtWithoutAssignmentReason which was
removed—reintroduce a local binding named evtWithoutAssignmentReason that is a
copy of evt with assignmentReason omitted before building payload; e.g., derive
evtWithoutAssignmentReason from evt via destructuring (remove assignmentReason)
and then use it in the payload construction so EventPayloadType no longer
includes assignmentReason while other evt properties remain. Ensure this binding
is declared above the const payload so the spread of evtWithoutAssignmentReason
resolves.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1f3cd1a2-fde4-475b-beab-b8b3a74ab6e9
📒 Files selected for processing (2)
packages/features/bookings/lib/getWebhookPayloadForBooking.tspackages/features/bookings/lib/service/RegularBookingService.ts
85761f3 to
9fe0a95
Compare
What does this PR do?
Fixes #28508
PR #27546 (async webhook migration) introduced a breaking change where
attendeeSeatIdwas removed from the top-level webhook payload. It isnow only accessible inside
attendees[].bookingSeat, which breaksexisting integrations that rely on the top-level
attendeeSeatIdfield.This restores
attendeeSeatIdat the top level of the webhook payloadfor backward compatibility, while keeping the new
bookingSeatstructure intact.
Visual Demo
N/A — webhook payload structure fix, no UI changes.
Mandatory Tasks
How should this be tested?
attendeeSeatIdis present at the top level of the payloadattendees[].bookingSeatstill exists (no regression)Checklist