[CLEAN] Synthetic Benchmark PR #26774 - feat: CalendarCache - filter generic calendars from subscription batch#701
Closed
tomerqodo wants to merge 1 commit intobase_pr_26774_20260121_9256from
Closed
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>
|
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: |
|
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. |
|
This PR has been closed due to inactivity. Please feel free to reopen it if you'd like to continue the work. |
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.
Benchmark PR calcom#26774
Type: Clean (correct implementation)
Original PR Title: feat: CalendarCache - filter generic calendars from subscription batch
Original PR Description: ## 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)
Original PR URL: calcom#26774