fix: generate unique videoCallUrl per recurring booking occurrence#28942
fix: generate unique videoCallUrl per recurring booking occurrence#28942ajayjha1 wants to merge 3 commits intocalcom:mainfrom
Conversation
For Cal Video (daily_video), each recurring booking occurrence now gets its own video room URL derived from its own uid, instead of all occurrences sharing the first booking's URL.
|
Welcome to Cal.diy, @ajayjha1! Thanks for opening this pull request. A few things to keep in mind:
A maintainer will review your PR soon. Thanks for contributing! |
|
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRemoved FIXME comment lines from three test assertions that referenced recurring bookings sharing the same video URL. In confirmation handling, recurring-booking updates now compute a per-occurrence 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/features/bookings/lib/handleConfirmation.ts (1)
408-417:⚠️ Potential issue | 🟡 MinorWebhook
BOOKING_CREATEDpayload diverges from per-occurrence DB storage for recurring Cal Video.The webhook payload at line 415 emits a shared
videoCallUrl(derived fromevt.videoCallData?.url, the primary/first occurrence's room), while the DB stores uniquemetadata.videoCallUrlper occurrence for Cal Video (lines 180-184). For recurring Cal Video events, subscribers receive only the first occurrence's URL via the single series-level webhook and cannot reconstruct per-occurrence URLs without re-querying the DB.Consider clarifying whether the single webhook per series is intentional or whether per-occurrence webhook payloads are expected. If the current design is intentional, document this constraint for webhook consumers.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/features/bookings/lib/handleConfirmation.ts` around lines 408 - 417, The webhook payload currently uses meetingUrl (evt.videoCallData?.url / meetingUrl) when building payload in the payload object, which emits the series-level room while the DB stores per-occurrence metadata.videoCallUrl; change payload construction in the block that builds payload (the payload constant in handleConfirmation.ts) to prefer the occurrence-specific URL from booking.metadata.videoCallUrl (or booking.metadata?.videoCallUrl) when present and fall back to meetingUrl, e.g. set metadata: meetingUrl ? { videoCallUrl: booking.metadata?.videoCallUrl || meetingUrl } : (booking.metadata || {}); additionally, if this behavior is intentional (single series webhook only), add a short comment and update webhook docs to state consumers must re-query per-occurrence URLs from the DB.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/features/bookings/lib/handleConfirmation.ts`:
- Around line 408-417: The webhook payload currently uses meetingUrl
(evt.videoCallData?.url / meetingUrl) when building payload in the payload
object, which emits the series-level room while the DB stores per-occurrence
metadata.videoCallUrl; change payload construction in the block that builds
payload (the payload constant in handleConfirmation.ts) to prefer the
occurrence-specific URL from booking.metadata.videoCallUrl (or
booking.metadata?.videoCallUrl) when present and fall back to meetingUrl, e.g.
set metadata: meetingUrl ? { videoCallUrl: booking.metadata?.videoCallUrl ||
meetingUrl } : (booking.metadata || {}); additionally, if this behavior is
intentional (single series webhook only), add a short comment and update webhook
docs to state consumers must re-query per-occurrence URLs from the DB.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d12a6279-7acd-4f0f-8763-902a5b6a6273
📒 Files selected for processing (2)
apps/web/pages/api/book/recurring-event.test.tspackages/features/bookings/lib/handleConfirmation.ts
💤 Files with no reviewable changes (1)
- apps/web/pages/api/book/recurring-event.test.ts
Fixes the bug where all recurring booking occurrences shared the same videoCallUrl.
Issue
When creating a recurring booking with Cal Video enabled:
All occurrences were assigned the same videoCallUrl (from the first booking's uid)
Future meetings pointed to the first occurrence's video room link
If the first link expired, all later meetings would break
Fix
For Cal Video (daily_video), each recurring booking occurrence now gets its own unique video room URL derived from its own uid:
occurrence 1 → .../video/uid-1
occurrence 2 → .../video/uid-2
occurrence 3 → .../video/uid-3
For other providers (Zoom, Google Meet, Teams), the shared meeting URL behavior is preserved since those integrations create one meeting per series by design.
Evidence
Existing FIXME comments in recurring-event.test.ts acknowledged this bug
Code inspection confirmed handleConfirmation.ts computed a single meetingUrl and applied it to all recurring bookings in the loop
Fixes #28871