-
-
Notifications
You must be signed in to change notification settings - Fork 656
fix: Fix PoolConnection.end() callback and promise resolution #3937
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3937 +/- ##
==========================================
- Coverage 89.78% 89.77% -0.02%
==========================================
Files 86 86
Lines 13607 13610 +3
Branches 1607 1608 +1
==========================================
+ Hits 12217 12218 +1
- Misses 1390 1392 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks, @CodeVoyager-bit! Can you add a variation with this fix in the test test/integration/graceful-end/test-end-with-graceful-end-config.test.cjs? About the lint error, you can run the command |
Updated deprecation warning message for conn.end() usage.
|
@wellwelwel can you please review it once |
| if (callback) { | ||
| callback(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is not being reached by the tests, I'm thinking of some approach to ensure continuity of this fix in the tests.
This PR fixes an issue where calling end() on a PoolConnection would not execute the provided callback or resolve the promise when using the Promise API.
Previously,
PoolConnection.end()did not accept any arguments, causing the callback to be ignored and the Promise wrapper to hang indefinitely.Changes
PoolConnection.prototype.endto accept a callback parameter.gracefulEndis false).super.end()whengracefulEndis true.Related Issue
Fixes #3915