feat: CalendarCache - filter generic calendars from subscription batch#26774
Merged
feat: CalendarCache - filter generic calendars from subscription batch#26774
Conversation
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 <volnei.munhoz@gmail.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
volnei
commented
Jan 12, 2026
packages/features/selectedCalendar/repositories/SelectedCalendarRepository.ts
Show resolved
Hide resolved
keithwillcode
requested changes
Jan 12, 2026
packages/features/selectedCalendar/repositories/SelectedCalendarRepository.test.ts
Show resolved
Hide resolved
| }, | ||
| }, | ||
| }, | ||
| AND: undefined, |
packages/features/selectedCalendar/repositories/SelectedCalendarRepository.test.ts
Show resolved
Hide resolved
packages/features/selectedCalendar/repositories/SelectedCalendarRepository.ts
Show resolved
Hide resolved
keithwillcode
approved these changes
Jan 13, 2026
This was referenced Jan 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Configures
SelectedCalendarRepository.findNextSubscriptionBatchto 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:
GENERIC_CALENDAR_SUFFIXESconstant inAdaptersFactorymapping providers to their generic calendar suffixesgetGenericCalendarSuffixes()method toAdapterFactoryinterfacefindNextSubscriptionBatchto accept and usegenericCalendarSuffixesparameter to filter out calendars with matching externalId suffixes using Prisma'sNOT+endsWithCalendarSubscriptionService.checkForNewSubscriptionsto pass generic calendar suffixes from the adapter factoryMandatory Tasks (DO NOT REMOVE)
How should this be tested?
SelectedCalendarRepositoryandCalendarSubscriptionServiceTZ=UTC yarn test packages/features/selectedCalendar/repositories/SelectedCalendarRepository.test.ts packages/features/calendar-subscription/lib/__tests__/CalendarSubscriptionService.test.ts@group.v.calendar.google.com) are not being pulled for subscriptionHuman Review Checklist
AND: undefinedcorrectly (should be ignored when no suffixes provided)Link to Devin run: https://app.devin.ai/sessions/fbf759af4f2242afb079020f2ff63245
Requested by: Volnei Munhoz (@volnei)