Skip to content

Conversation

@everettbu
Copy link

Test 2

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR implements a significant architectural change to make all app store package imports asynchronous across the Cal.com codebase. The core change is in packages/app-store/index.ts, which converts all static imports to dynamic imports using import() statements for calendar integrations, video providers, payment processors, and other app store packages.

This refactoring touches multiple critical components:

  • Calendar Management: CalendarManager.ts, EventManager.ts, and getCalendar.ts now handle async calendar loading
  • Video Services: videoClient.ts converts from synchronous to async video adapter loading
  • Payment Processing: Payment-related files like handlePayment.ts and deletePayment.ts now await app store access
  • Booking Operations: Core booking flows in handleNewBooking.ts, handleCancelBooking.ts, and reschedule operations now handle async calendar operations

The change enables lazy loading of integrations, potentially reducing initial bundle size and improving startup performance by loading only the integrations actually needed at runtime. This is particularly beneficial for Cal.com given its extensive integration ecosystem.

PR Description Notes:

  • The PR body only contains "Test 2" which lacks any meaningful description of the changes

Confidence score: 2/5

  • This PR has critical implementation flaws that will cause production issues, particularly with async forEach loops that won't properly wait for operations to complete
  • Multiple files use forEach with async callbacks which creates race conditions and potential data loss during booking operations
  • Files with critical issues: packages/app-store/wipemycalother/lib/reschedule.ts, packages/app-store/vital/lib/reschedule.ts, packages/trpc/server/routers/viewer/bookings.tsx
  • The core architectural change is sound but the implementation has serious async handling problems

12 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

calendarType = calendarType.split("_other_calendar")[0];
}
const calendarApp = appStore[calendarType.split("_").join("") as keyof typeof appStore];
const calendarApp = await appStore[calendarType.split("_").join("") as keyof typeof appStore];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider adding try-catch around the await to handle import failures gracefully

calendarType = calendarType.split("_other_calendar")[0];
}
const calendarApp = appStore[calendarType.split("_").join("") as keyof typeof appStore];
const calendarApp = await appStore[calendarType.split("_").join("") as keyof typeof appStore];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider adding try-catch around the await to handle import failures gracefully

@github-actions
Copy link
Contributor

This PR is being marked as stale due to inactivity.

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