Skip to content

feat: Replace sync normalized-data with async flow (API-432)#49

Merged
hilnius merged 2 commits into
mainfrom
robinnicollet/api-432-sample-app-replace-sync-normalized-data-with-async-flow
Jul 17, 2026
Merged

feat: Replace sync normalized-data with async flow (API-432)#49
hilnius merged 2 commits into
mainfrom
robinnicollet/api-432-sample-app-replace-sync-normalized-data-with-async-flow

Conversation

@hilnius

@hilnius hilnius commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Showcase the recommended integration pattern for generate-normalized-data-async with a shared pollUntilSucceeded helper: poll after 10 seconds, stop after 5 minutes

hilnius and others added 2 commits July 17, 2026 12:00
Showcase the recommended integration pattern for generate-normalized-data-async with a shared pollUntilSucceeded helper.

Co-authored-by: Cursor <cursoragent@cursor.com>
@hilnius hilnius self-assigned this Jul 17, 2026
@hilnius
hilnius merged commit 5fb8bb2 into main Jul 17, 2026
8 checks passed

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7d43ecc. Configure here.

throw new Error(`Did not get results within ${timeoutMs}ms. Aborting polling.`);
}

const job = await fetchJob();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Timeout check before fetch discards completed results

Medium Severity

The deadline check on line 23 runs after sleep but before fetchJob, so when the timeout expires, the function throws without making one final status check. If the async job completed during the last sleep interval, pollUntilSucceeded reports a spurious timeout instead of returning the successful result. Moving the deadline check after the fetchJob call (or after the status checks) would avoid discarding a ready result.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7d43ecc. Configure here.

@hilnius
hilnius deleted the robinnicollet/api-432-sample-app-replace-sync-normalized-data-with-async-flow branch July 17, 2026 11:18
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.

1 participant