-
Notifications
You must be signed in to change notification settings - Fork 0
Async import of the appStore packages #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: appstore-sync-refactor-base
Are you sure you want to change the base?
Async import of the appStore packages #10
Conversation
|
@claude review this PR |
1 similar comment
|
@claude review this PR |
|
Claude finished @akshayutture-augment's task —— View job Code Review: Async Import of appStore PackagesI've completed my review of this PR which converts synchronous imports to async dynamic imports for app store packages. Here are my findings: 🔴 Critical Issues1. Race Condition in forEach with async callbacks (Multiple files)Location: 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: Using
Recommendation: Replace // Option 1: Sequential execution
for (const bookingRef of bookingRefsFiltered) {
if (bookingRef.uid) {
if (bookingRef.type.endsWith("_calendar")) {
const calendar = await getCalendar(credentialsMap.get(bookingRef.type));
await calendar?.deleteEvent(bookingRef.uid, builder.calendarEvent);
}
}
}
// Option 2: Parallel execution
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);
}
}
}));2. Inconsistent Promise Handling in CalendarManager.getCalendarCredentialsLocation: const credentials = app.credentials.flatMap((credential) => {
const calendar = getCalendar(credential); // Returns Promise, but not awaited!
return app.variant === "calendar" ? [{ integration: app, credential, calendar }] : [];
});Problem: Recommendation: Keep the current approach consistent (store promises and await them when needed), but add a comment explaining this pattern for clarity.
|
|
This PR is being marked as stale due to inactivity. |
Test 2
Replicated from ai-code-review-evaluation/cal.com-greptile#2