Async import of the appStore packages#1
Conversation
|
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: |
|
Claude finished @ShashankFC's task in 1m 45s —— View job Code Review CompleteTodo List
OverviewThis PR converts the app-store package imports from synchronous to asynchronous dynamic imports, which is a good performance optimization. However, there are several critical bugs that need to be addressed. 🔴 Critical Issues1. Async forEach Anti-Pattern (Multiple Locations)Several files use packages/app-store/vital/lib/reschedule.ts:125-129 and packages/app-store/wipemycalother/lib/reschedule.ts:125-129: bookingRefsFiltered.forEach(async (bookingRef) => {
if (bookingRef.uid) {
if (bookingRef.type.endsWith("_calendar")) {
const calendar = await getCalendar(credentialsMap.get(bookingRef.type));
return calendar?.deleteEvent(bookingRef.uid, builder.calendarEvent);Problem: Solution: Use await Promise.all(
bookingRefsFiltered.map(async (bookingRef) => {
if (bookingRef.uid) {
if (bookingRef.type.endsWith("_calendar")) {
const calendar = await getCalendar(credentialsMap.get(bookingRef.type));
return calendar?.deleteEvent(bookingRef.uid, builder.calendarEvent);
}
// ... rest of logic
}
})
);packages/trpc/server/routers/viewer/bookings.tsx:553-563: bookingRefsFiltered.forEach(async (bookingRef) => {
if (bookingRef.uid) {
if (bookingRef.type.endsWith("_calendar")) {
const calendar = await getCalendar(credentialsMap.get(bookingRef.type));Same issue here - needs to be converted to 2. Missing
|
|
This PR is being marked as stale due to inactivity. |
Test 2nn---nReplicated from ai-code-review-evaluation/cal.com-greptile#2