Code Review Bench PR #26774 - feat: CalendarCache - filter generic calendars from subscription batch#7
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>
| import type { Prisma } from "@calcom/prisma/client"; | ||
|
|
||
| export class SelectedCalendarRepository implements ISelectedCalendarRepository { | ||
| export class PrismaSelectedCalendarRepository implements ISelectedCalendarRepository { |
There was a problem hiding this comment.
🚨 Bug: Class rename breaks 3 consumers that import the old name
The class was renamed from SelectedCalendarRepository to PrismaSelectedCalendarRepository in SelectedCalendarRepository.ts, but three files still import and instantiate the old name SelectedCalendarRepository:
apps/web/app/api/webhooks/calendar-subscription/[provider]/route.ts— line 14 imports it, line 61 instantiates itapps/web/app/api/cron/calendar-subscriptions/route.ts— line 11 imports it, line 41 instantiates itpackages/features/selectedCalendar/repositories/SelectedCalendarRepository.test.ts— line 2 imports it, lines 50 and 53 use it
There is no barrel file or re-export that aliases the old name. This will cause a build failure (import resolution error) for the webhook route, the cron route, and the repository's own test file.
Fix: Either revert the rename (if it wasn't intentional), or update all three consumer files to import PrismaSelectedCalendarRepository instead. A common pattern is to also add a re-export for backward compatibility:
export { PrismaSelectedCalendarRepository as SelectedCalendarRepository };Was this helpful? React with 👍 / 👎
| export class PrismaSelectedCalendarRepository implements ISelectedCalendarRepository { | |
| export { PrismaSelectedCalendarRepository as SelectedCalendarRepository }; | |
| export class PrismaSelectedCalendarRepository implements ISelectedCalendarRepository { |
- Apply suggested fix
There was a problem hiding this comment.
Configure merge blocking · Maintainers can dismiss this review. Gitar never approves changes.
Code Review 🚫 Blocked 0 resolved / 1 findingsThe filtering feature is well-designed but the class rename from 🚨 Bug: Class rename breaks 3 consumers that import the old name📄 packages/features/selectedCalendar/repositories/SelectedCalendarRepository.ts:5 The class was renamed from
There is no barrel file or re-export that aliases the old name. This will cause a build failure (import resolution error) for the webhook route, the cron route, and the repository's own test file. Fix: Either revert the rename (if it wasn't intentional), or update all three consumer files to import export { PrismaSelectedCalendarRepository as SelectedCalendarRepository };Suggested fixRules 🎸 1 action takenGitar Rules
5 rules not applicable. Show all rules by commenting OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
Benchmark Evaluation ResultsGround Truth Bugs (Recall: 1/2 = 50.0%)
Extra Gitar Findings
Summary
|
Benchmark PR for Gitar evaluation
Original PR: agentic-review-benchmarks#7
feat: CalendarCache - filter generic calendars from subscription batch
Summary by Gitar
AdapterFactory,CalendarSubscriptionService, andPrismaSelectedCalendarRepository@group.v.calendar.google.com,@import.calendar.google.com, etc.) via Prisma query-level AND/NOT conditionsGENERIC_CALENDAR_SUFFIXESconfiguration supports multiple providers (Google Calendar, Office365) with optional parameters ensuring backward compatibility