Skip to content

Async import of the appStore packages#10

Open
akshayutture-augment wants to merge 1 commit into
appstore-sync-refactor-basefrom
appstore-async-improvements
Open

Async import of the appStore packages#10
akshayutture-augment wants to merge 1 commit into
appstore-sync-refactor-basefrom
appstore-async-improvements

Conversation

@akshayutture-augment

@akshayutture-augment akshayutture-augment commented Nov 17, 2025

Copy link
Copy Markdown

No description provided.

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 4 suggestions posted.

Comment augment review to trigger a new review at any time.

);
try {
bookingRefsFiltered.forEach((bookingRef) => {
bookingRefsFiltered.forEach(async (bookingRef) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Async callbacks in Array.forEach() are not awaited, so these delete operations may run in the background and any rejection from await getCalendar won’t be caught by this try/catch. This can lead to unhandled rejections and incomplete cancellations.

🤖 Was this useful? React with 👍 or 👎

);
try {
bookingRefsFiltered.forEach((bookingRef) => {
bookingRefsFiltered.forEach(async (bookingRef) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Async callbacks in Array.forEach() are not awaited, so these delete operations may run in the background and any rejection from await getCalendar won’t be caught by this try/catch. This can lead to unhandled rejections and incomplete cancellations.

🤖 Was this useful? React with 👍 or 👎

(ref) => !!credentialsMap.get(ref.type)
);
bookingRefsFiltered.forEach((bookingRef) => {
bookingRefsFiltered.forEach(async (bookingRef) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using an async callback with Array.forEach() means these cancel operations aren’t awaited; any failure from await getCalendar (or subsequent calls) can go unhandled and the routine may proceed before deletions complete. This risks inconsistent state in reschedules.

🤖 Was this useful? React with 👍 or 👎

@@ -458,7 +458,7 @@ async function handler(req: CustomRequest) {
bookingToDelete.user.credentials
.filter((credential) => credential.type.endsWith("_calendar"))
.forEach(async (credential) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Async callbacks in forEach() are not awaited; pushing to apiDeletes inside this loop may race with any later Promise.all on that array, and errors from await getCalendar will bypass the surrounding try/catch. This can cause missed deletions and unhandled rejections.

🤖 Was this useful? React with 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants