fix: CalDAV default calendar not written on booking#28445
fix: CalDAV default calendar not written on booking#28445Harshithk951 wants to merge 17 commits intocalcom:mainfrom
Conversation
|
@sahitya-chandra I don't have access to a CalDAV provider (e.g. GMX) to record a |
1dac870 to
7a38fb5
Compare
sahitya-chandra
left a comment
There was a problem hiding this comment.
Can't approve this without video evidence...
Will you be able to provide it?
|
Hi @sahitya-chandra, yes! I have just updated the PR description with video evidence showing a successful booking flow with a CalDAV calendar. It confirms that the default calendar is now correctly identified and written to. Let me know if you need anything else! |
|
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)
📝 WalkthroughWalkthroughThe 🚥 Pre-merge checks | ✅ 3✅ 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/lib/CalendarService.ts`:
- Around line 466-481: The code can silently succeed when targetCalendars is
empty; add an explicit guard after computing targetCalendars in the function
containing targetCalendars and createCalendarObject: if targetCalendars.length
=== 0, return or throw an error (consistent with surrounding error handling)
indicating "no target calendars" so you don't proceed to Promise.all; ensure
this uses the same response shape as the function's other error returns (or sets
an appropriate non-ok response) so callers relying on responses.some((r) =>
!r.ok) will see the failure.
🪄 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: 03fb68ba-50cb-442e-83be-00a68c433eef
📒 Files selected for processing (1)
packages/lib/CalendarService.ts
What does this PR do?
When "Add to calendar" is set to "Default" in the CalDAV app, no calendar entry was created on booking even though confirmation emails were sent correctly.
Root cause: the filter in
BaseCalendarService.createEventfell through with: truewhen nodestinationCalendarexternalId was set, causingcreateCalendarObjectto fire against every discovered calendar collection. Servers like GMX silently drop these writes so no entry is ever created.Fix: replace
: truewithcalendars.slice(0, 1)— use only the first (primary) calendar when no explicit destination is configured. The explicit-calendar path is unchanged.Mandatory Tasks
How should this be tested?
Checklist
Screen.Recording.2026-03-25.at.8.18.49.PM.mov