feat: CalendarCache - filter generic calendars from subscription batch#7
Open
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>
🤖 Augment PR SummarySummary: This PR prevents “generic” calendars (e.g., holidays/imported/resources) from being included in the subscription batching used by CalendarCache. Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
| import type { Prisma } from "@calcom/prisma/client"; | ||
|
|
||
| export class SelectedCalendarRepository implements ISelectedCalendarRepository { | ||
| export class PrismaSelectedCalendarRepository implements ISelectedCalendarRepository { |
There was a problem hiding this comment.
Renaming the exported class to PrismaSelectedCalendarRepository changes the module’s public API; there are still call sites importing/constructing SelectedCalendarRepository, which will break at runtime/build time unless they were updated consistently.
Other Locations
apps/web/app/api/cron/calendar-subscriptions/route.ts:41apps/web/app/api/webhooks/calendar-subscription/[provider]/route.ts:61packages/features/selectedCalendar/repositories/SelectedCalendarRepository.test.ts:3
🤖 Was this useful? React with 👍 or 👎
| }: { | ||
| take: number; | ||
| teamIds: number[]; | ||
| integrations?: string[]; |
There was a problem hiding this comment.
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 from agentic-review-benchmarks#7