Skip to content

fix: queue loading Cancel button and launch abort (OPEN-10)#176

Merged
zortos293 merged 2 commits intodevfrom
cursor/OPEN-10-queue-cancel-button-79b8
Apr 1, 2026
Merged

fix: queue loading Cancel button and launch abort (OPEN-10)#176
zortos293 merged 2 commits intodevfrom
cursor/OPEN-10-queue-cancel-button-79b8

Conversation

@zortos293
Copy link
Copy Markdown
Collaborator

@zortos293 zortos293 commented Mar 31, 2026

Description

Fixes the queue/setup Cancel flow in handlePlayGame to avoid showing a false launch failure after an intentional cancel.

Cause: if cancel stops the server-side session while pollSession is in-flight, pollSession can throw. That exception reached the outer catch path, which unconditionally set launch error state and displayed "Launch Failed".

Changes:

  • Keep existing abort checks around polling loop returns.
  • Add an abort-aware early return at the top of handlePlayGame's catch block (if (launchAbortRef.current) return;).
  • Preserve existing error handling for genuine launch failures.

Linear Issue: OPEN-10

Open in Web Open in Cursor 

…anly

Raise StreamLoading z-index above StreamView so Cancel receives clicks.
Add launch abort ref: cancel during queue/setup skips exit dialog, sets abort
before stopSession, and exits the poll loop without duplicate cleanup.

Co-authored-by: Zortos <zortosdev@proton.me>
@zortos293 zortos293 marked this pull request as ready for review April 1, 2026 07:26
Copy link
Copy Markdown

@cursor cursor bot left a comment

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, enable autofix in the Cursor dashboard.

if (launchAbortRef.current) {
return;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Catch block ignores abort flag, shows spurious error

Medium Severity

The catch block in handlePlayGame doesn't check launchAbortRef.current. When the user cancels during loading, handleStopStream stops the session server-side. If pollSession was already in-flight, the server may return an error for the now-stopped session, causing pollSession to throw. That exception bypasses the abort-aware return statements in the polling loop and falls into the catch block, which calls setLaunchError(...) and resetLaunchRuntime({ keepLaunchError: true }), showing a "Launch Failed" error to a user who intentionally clicked Cancel.

Additional Locations (1)
Fix in Cursor Fix in Web

Co-authored-by: Zortos <zortosdev@proton.me>
@zortos293 zortos293 merged commit 0ef47ae into dev Apr 1, 2026
5 checks passed
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