Async import of the appStore packages#10
Conversation
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| if (bookingRef.uid) { | ||
| if (bookingRef.type.endsWith("_calendar")) { | ||
| const calendar = getCalendar(credentialsMap.get(bookingRef.type)); | ||
| const calendar = await getCalendar(credentialsMap.get(bookingRef.type)); |
There was a problem hiding this comment.
Async forEach callbacks cause unhandled rejections and bypass try-catch
High Severity
The forEach callback was changed from synchronous to async, but Array.forEach does not await promises returned by async callbacks. This makes all calendar/video deletion operations fire-and-forget. In the vital and wipemycalother files, this also completely bypasses the surrounding try-catch block — rejected promises from getCalendar or deleteEvent become unhandled promise rejections instead of being caught. A for...of loop with await (as correctly done elsewhere in this PR, e.g., handleCancelBooking.ts line 480) is needed.


Test 2nn
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.
nn---n*Replicated from [ai-code-review-evaluation/cal.com-coderabbit#2](https://github.com/ai-code-review-evaluation/cal.com-coderabbit/pull/2)*Note
Medium Risk
Touches core booking lifecycle integration hooks (calendar/video/payment) and changes sync calls to async, which can introduce missed awaits or altered execution ordering during cancellations/reschedules.
Overview
Refactors
appStoreto return dynamicimport()promises for each integration, switching integration loading from eager module imports to lazy async resolution.Updates calendar/video/payment codepaths to await app modules and services:
getCalendarbecomes async,videoClientadapter creation is async, and booking/event flows (create/update/delete/reschedule/cancel + payment refund/delete/create) now await calendar instances and payment apps before invoking integration methods.Written by Cursor Bugbot for commit e043a5e. Configure here.