Skip to content

Conversation

@tomerqodo
Copy link

Benchmark PR calcom#26774

Type: Corrupted (contains bugs)

Original PR Title: feat: CalendarCache - filter generic calendars from subscription batch
Original PR Description: ## What does this PR do?

Configures SelectedCalendarRepository.findNextSubscriptionBatch to ignore generic calendars (holidays, contacts, shared, imported, resource calendars) by filtering based on their externalId suffixes.

Generic calendars are special calendars that shouldn't be subscribed to for sync because they're not user's personal calendars. For Google Calendar, these include calendars with suffixes like @group.v.calendar.google.com, @group.calendar.google.com, @import.calendar.google.com, and @resource.calendar.google.com.

Changes:

  • Add GENERIC_CALENDAR_SUFFIXES constant in AdaptersFactory mapping providers to their generic calendar suffixes
  • Add getGenericCalendarSuffixes() method to AdapterFactory interface
  • Update findNextSubscriptionBatch to accept and use genericCalendarSuffixes parameter to filter out calendars with matching externalId suffixes using Prisma's NOT + endsWith
  • Update CalendarSubscriptionService.checkForNewSubscriptions to pass generic calendar suffixes from the adapter factory

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.
  • N/A - No documentation changes required.

How should this be tested?

  1. Unit tests have been added/updated for both SelectedCalendarRepository and CalendarSubscriptionService
  2. Run tests: TZ=UTC yarn test packages/features/selectedCalendar/repositories/SelectedCalendarRepository.test.ts packages/features/calendar-subscription/lib/__tests__/CalendarSubscriptionService.test.ts
  3. To verify in production: Check that calendars with generic suffixes (e.g., holiday calendars ending in @group.v.calendar.google.com) are not being pulled for subscription

Human Review Checklist

  • Verify the Prisma query handles AND: undefined correctly (should be ignored when no suffixes provided)
  • Verify the list of Google Calendar generic suffixes is complete for your use case
  • Consider if Office 365 calendars need similar suffix filtering (currently empty array)

Link to Devin run: https://app.devin.ai/sessions/fbf759af4f2242afb079020f2ff63245
Requested by: Volnei Munhoz (@volnei)
Original PR URL: calcom#26774

devin-ai-integration bot and others added 2 commits January 21, 2026 15:41
Add filtering to SelectedCalendarRepository.findNextSubscriptionBatch to
exclude generic calendars (holidays, contacts, shared, imported, resources)
based on their externalId suffixes.

Changes:
- Add GENERIC_CALENDAR_SUFFIXES constant mapping providers to their
  generic calendar suffixes in AdaptersFactory
- Add getGenericCalendarSuffixes method to AdapterFactory interface
- Update findNextSubscriptionBatch to accept and use genericCalendarSuffixes
  parameter to filter out calendars with matching externalId suffixes
- Update CalendarSubscriptionService.checkForNewSubscriptions to pass
  generic calendar suffixes from the adapter factory
- Update tests to cover the new filtering logic

Co-Authored-By: Volnei Munhoz <[email protected]>
@github-actions
Copy link

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "[CORRUPTED] Synthetic Benchmark PR #26774 - feat: CalendarCache - filter generic calendars from subscription batch". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@github-actions
Copy link

This PR has been marked as stale due to inactivity. If you're still working on it or need any help, please let us know or update the PR to keep it active.

@github-actions github-actions bot added the Stale label Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants