Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cancelling queries #86

Merged
merged 1 commit into from Nov 30, 2023
Merged

Conversation

MasterOdin
Copy link
Contributor

@MasterOdin MasterOdin commented Nov 29, 2023

PR fixes a bug introduced in #74, where the logic was changed such that anything except a 200 response was considered an error. However, when cancelling a query, a 204 is returned, and that would cause the callback passed to .kill to have an error object, though the query itself was still properly cancelled. I've included tests for the two paths wherein a user may have a query be cancelled.

I was not able to reproduce the error reported in #75, and the tests use relatively latest versions of presto/trino, so I"m not sure why they were seeing a 404 error.

This also fixes a bug where if you did not pass a callback to kill method, then would hit an undefined error, but only if an error was returned from the request. If no error was returned, then things would work fine. Now, if no callback is provided, then the error (or not) is silently swallowed, otherwise passed back to the user.

@tagomoris
Copy link
Owner

LGTMj. Thank you!

@tagomoris tagomoris merged commit 29a7739 into tagomoris:master Nov 30, 2023
3 checks passed
@mfulton26
Copy link

@tagomoris, I ran into this issue recently. It doesn't look like this fix has been released to NPM yet. May a new version be published to NPM sometime soon?

@tagomoris
Copy link
Owner

I've published v1.1.0 with this change.
@mfulton26 Thank you for pinging me!

@MasterOdin MasterOdin deleted the fix-cancel-queries branch January 3, 2024 16:06
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.

None yet

3 participants