Skip to content

fix: restore attendeeSeatId to top-level webhook payload for backward compatibility#28528

Open
Harshithk951 wants to merge 9 commits intocalcom:mainfrom
Harshithk951:fix/restore-attendee-seat-id-in-webhook-payload
Open

fix: restore attendeeSeatId to top-level webhook payload for backward compatibility#28528
Harshithk951 wants to merge 9 commits intocalcom:mainfrom
Harshithk951:fix/restore-attendee-seat-id-in-webhook-payload

Conversation

@Harshithk951
Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #28508

PR #27546 (async webhook migration) introduced a breaking change where
attendeeSeatId was removed from the top-level webhook payload. It is
now only accessible inside attendees[].bookingSeat, which breaks
existing integrations that rely on the top-level attendeeSeatId field.

This restores attendeeSeatId at the top level of the webhook payload
for backward compatibility, while keeping the new bookingSeat
structure intact.

Visual Demo

N/A — webhook payload structure fix, no UI changes.

Mandatory Tasks

  • I have self-reviewed the code.
  • I have updated the developer docs in /docs if required. N/A
  • I confirm automated tests are in place that prove my fix is effective.

How should this be tested?

  1. Create a seated event type
  2. Book a seat on that event
  3. Observe the webhook payload sent to your endpoint
  4. Confirm attendeeSeatId is present at the top level of the payload
  5. Confirm attendees[].bookingSeat still exists (no regression)

Checklist

  • I have read the contributing guide
  • My code follows the style guidelines of this project
  • My changes generate no new warnings
  • This PR is small (1 file, 1 line changed)

@Harshithk951 Harshithk951 requested a review from a team as a code owner March 21, 2026 10:31
@github-actions github-actions bot added the 🐛 bug Something isn't working label Mar 21, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread apps/api/v2/src/modules/deployments/deployments.service.ts Outdated
Comment thread packages/features/bookings/lib/service/RegularBookingService.ts
@Harshithk951 Harshithk951 force-pushed the fix/restore-attendee-seat-id-in-webhook-payload branch from b97f658 to c89a923 Compare March 21, 2026 15:48
Copy link
Copy Markdown
Member

@sahitya-chandra sahitya-chandra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a before and after video of the changes

@Harshithk951
Copy link
Copy Markdown
Contributor Author

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:

  1. Creating a seated event type
  2. Booking a seat on that event
  3. Checking the webhook payload — attendeeSeatId is now present at the top level alongside the existing attendees[].bookingSeat structure

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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 195efed2-75c6-4e24-9bd5-d80bb5c665a4

📥 Commits

Reviewing files that changed from the base of the PR and between 85761f3 and d35dbbe.

📒 Files selected for processing (2)
  • packages/features/bookings/lib/getWebhookPayloadForBooking.ts
  • packages/features/bookings/lib/service/RegularBookingService.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/features/bookings/lib/getWebhookPayloadForBooking.ts
  • packages/features/bookings/lib/service/RegularBookingService.ts

📝 Walkthrough

Walkthrough

The PR adjusts webhook payload construction for bookings to conditionally include attendeeSeatId when present. In packages/features/bookings/lib/getWebhookPayloadForBooking.ts the destructuring that omits assignmentReason was relocated (its declaration moved outside the prior block), and the constructed payload now uses a conditional spread for attendeeSeatId. The same conditional inclusion was added to packages/features/bookings/lib/service/RegularBookingService.ts.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ❓ Inconclusive The PR partially addresses linked issue #28508's core objective (restoring top-level attendeeSeatId) but lacks implementation of automated tests and comprehensive verification as required. Verify that automated tests have been added to validate top-level attendeeSeatId presence and attendees[].bookingSeat preservation; confirm test coverage matches the linked issue requirements.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately summarizes the main change: restoring attendeeSeatId to the webhook payload for backward compatibility.
Description check ✅ Passed The description is directly related to the changeset, explaining the fix, referencing issue #28508, and providing testing steps.
Out of Scope Changes check ✅ Passed All changes directly address the linked issue objective of restoring attendeeSeatId to the webhook payload; no unrelated or extraneous modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between facc074 and 85761f3.

📒 Files selected for processing (2)
  • packages/features/bookings/lib/getWebhookPayloadForBooking.ts
  • packages/features/bookings/lib/service/RegularBookingService.ts

Comment thread packages/features/bookings/lib/getWebhookPayloadForBooking.ts Outdated
@Harshithk951 Harshithk951 force-pushed the fix/restore-attendee-seat-id-in-webhook-payload branch from 85761f3 to 9fe0a95 Compare April 6, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Webhook payload changes

2 participants