Skip to content

Return the cancel request's promise from query.cancel() - #1237

Open
chrbala wants to merge 1 commit into
porsager:masterfrom
chrbala:fix-cancel-returns-promise
Open

chrbala wants to merge 1 commit into
porsager:masterfrom
chrbala:fix-cancel-returns-promise

Conversation

@chrbala

@chrbala chrbala commented Sep 30, 2026

Copy link
Copy Markdown

query.cancel() sent the cancel request on a connection of its own but dropped the promise that request settles, and returned null. A cancel request that failed, for example because that connection could not be opened, was then an unhandled rejection, which ends a Node process by default, and the caller had no way to handle it.

Return the promise instead, and the same promise on later calls, which still send no second request. Its type is now Promise<void>, and the README says how it settles.

`query.cancel()` sent the cancel request on a connection of its own but
dropped the promise that request settles, and returned null. A cancel
request that failed, for example because that connection could not be
opened, was then an unhandled rejection, which ends a Node process by
default, and the caller had no way to handle it.

Return the promise instead, and the same promise on later calls, which
still send no second request. Its type is now `Promise<void>`, and the
README says how it settles.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@chrbala

chrbala commented Sep 30, 2026

Copy link
Copy Markdown
Author

I made a few PRs from Claude which fix some problems I was having. Can you take a look?

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