Skip to content

fix(calendar): sync Cal.diy iCalUID events#29580

Open
Shreyas2004wagh wants to merge 1 commit into
calcom:mainfrom
Shreyas2004wagh:fix/calendar-sync-cal-diy-uid
Open

fix(calendar): sync Cal.diy iCalUID events#29580
Shreyas2004wagh wants to merge 1 commit into
calcom:mainfrom
Shreyas2004wagh:fix/calendar-sync-cal-diy-uid

Conversation

@Shreyas2004wagh

@Shreyas2004wagh Shreyas2004wagh commented Jun 15, 2026

Copy link
Copy Markdown

Summary

Fixes #29575

Calendar subscription sync now accepts Cal-managed iCalUID suffixes instead of only accepting @cal.com. This preserves legacy @cal.com events while allowing default Cal.diy-generated UIDs such as bookingUid@Cal.diy to flow through cancellation and reschedule sync.

Root Cause

Cal.diy generates fallback iCalUIDs from APP_NAME, which defaults to Cal.diy. CalendarSyncService.handleEvents filtered incoming subscription events with an @cal.com-only suffix check, so valid default Cal.diy booking events were skipped before the booking repository was queried.

Changes

  • Added a Cal-managed iCalUID suffix check using legacy cal.com, default cal.diy, and the configured APP_NAME.
  • Added a regression test covering test-booking-uid@Cal.diy.
  • Kept external UIDs such as @external.com ignored.

Testing

  • yarn vitest run packages/features/calendar-subscription/lib/sync/__tests__/CalendarSyncService.test.ts - 21 tests passed

@github-actions github-actions Bot added the 🐛 bug Something isn't working label Jun 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to Cal.diy, @Shreyas2004wagh! Thanks for opening this pull request.

A few things to keep in mind:

  • This is Cal.diy, not Cal.com. Cal.diy is a community-driven, fully open-source fork of Cal.com licensed under MIT. Your changes here will be part of Cal.diy — they will not be deployed to the Cal.com production app.
  • Please review our Contributing Guidelines if you haven't already.
  • Make sure your PR title follows the Conventional Commits format.

A maintainer will review your PR soon. Thanks for contributing!

@Shreyas2004wagh Shreyas2004wagh marked this pull request as ready for review June 15, 2026 16:50
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 5e8740e5-8010-4b5c-9f16-9f00d4b87b3a

📥 Commits

Reviewing files that changed from the base of the PR and between dcd0da8 and 4d5bf83.

📒 Files selected for processing (2)
  • packages/features/calendar-subscription/lib/sync/CalendarSyncService.ts
  • packages/features/calendar-subscription/lib/sync/__tests__/CalendarSyncService.test.ts

📝 Walkthrough

Walkthrough

CalendarSyncService replaces the hardcoded endsWith('@cal.com') iCalUID filter with an isCalManagedICalUID helper. The helper defines a constant suffix set containing cal.com, cal.diy, and APP_NAME, extracts the domain portion of the iCalUID, lowercases it, and checks it against the set. The handleEvents method's event-filtering call is updated to use this helper. A new test case is added to cover iCalUIDs ending with @Cal.diy, asserting that the booking lookup is called with the expected UID. Four existing resolves.not.toThrow() assertions are reformatted to multi-line style.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'fix(calendar): sync Cal.diy iCalUID events' is concise and accurately describes the main change—enabling calendar sync to handle Cal.diy iCalUID events.
Description check ✅ Passed The PR description comprehensively explains the issue, root cause, changes made, and testing results, directly relating to the changeset.
Linked Issues check ✅ Passed The PR implementation fully addresses issue #29575 by expanding iCalUID suffix validation to accept Cal.diy suffixes alongside legacy @cal.com, with tests confirming the fix.
Out of Scope Changes check ✅ Passed All changes are directly scoped to issue #29575: the core logic update in CalendarSyncService and regression tests in the test file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.

@kartik-212004

Copy link
Copy Markdown
Member

fix the suggested changes, otherwise the pr looks good

@Shreyas2004wagh

Copy link
Copy Markdown
Author

Hi @kartik-212004 , Thanks for checking it. I looked through the PR review threads and did not see any actionable inline suggestions. CodeRabbit also says no actionable comments were generated.

Could you point me to the specific suggested change you want addressed?

@Shreyas2004wagh

Copy link
Copy Markdown
Author

The CodeRabbit “Generate unit tests” item appears to be an optional beta suggestion rather than an actionable review comment, the PR already includes a regression unit test for test-booking-uid@Cal.diy in CalendarSyncService.test.ts.

If there is another specific suggested change you meant, please point me to it and I’ll address it.

@kartik-212004

Copy link
Copy Markdown
Member

Hi @kartik-212004 , Thanks for checking it. I looked through the PR review threads and did not see any actionable inline suggestions. CodeRabbit also says no actionable comments were generated.

Could you point me to the specific suggested change you want addressed?

could you see it now?

@Shreyas2004wagh

Copy link
Copy Markdown
Author

Hi @kartik-212004 , Thanks for checking it. I looked through the PR review threads and did not see any actionable inline suggestions. CodeRabbit also says no actionable comments were generated.
Could you point me to the specific suggested change you want addressed?

could you see it now?

I think the only visible item is CodeRabbit’s optional “Generate unit tests (beta)” checkbox. That is not an actionable review comment, and this PR already includes a regression unit test for the Cal.diy iCalUID case.

Let me know if I am missing something

@Shreyas2004wagh

Copy link
Copy Markdown
Author

Hi @kartik-212004 , let me know what are the changes to be done ?

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/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calendar subscription sync ignores Cal.diy iCalUIDs

2 participants