fix: restore PoolConnection as subclass of Connection#4183
Merged
wellwelwel merged 8 commits intosidorares:masterfrom Mar 15, 2026
Merged
fix: restore PoolConnection as subclass of Connection#4183wellwelwel merged 8 commits intosidorares:masterfrom
PoolConnection as subclass of Connection#4183wellwelwel merged 8 commits intosidorares:masterfrom
Conversation
PoolConnection as subclass of Connection
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4183 +/- ##
==========================================
+ Coverage 90.58% 90.69% +0.10%
==========================================
Files 87 86 -1
Lines 14281 14266 -15
Branches 1798 1802 +4
==========================================
+ Hits 12937 12939 +2
+ Misses 1344 1327 -17
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:
|
Collaborator
Author
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




This PR restores
PoolConnectionas a proper subclass ofConnection, fixing theinstanceofcheck that broke in 3.11.5 after the circular dependency refactor (#3081).Closes #3273.
Before #3081, the inheritance chain was:
PoolConnection→ConnectionAfter #3081 resolved circular dependencies, it became:
PoolConnection→BasePoolConnection→BaseConnectionThis caused
PoolConnection.prototype instanceof Connectionto returnfalse, an unintentional breaking change released as a patch.Now,
PoolConnectionextendsConnectiondirectly, inlining the pool-specific logic that was inBasePoolConnection(constructor,release,end,destroy,_removeFromPool):PoolConnection→Connection→BaseConnectionNote
lib/base/pool_connection.jsis removedThe typing previously had redundant interfaces that shadowed class exports from
export *:These interfaces were structurally identical to their respective classes and only served to hide the class value from the export. Removing them and adding
export * from './lib/PoolConnection.js'makes bothConnectionandPoolConnectionavailable as constructors (now it's additive, not breaking).Important
An alternative approach was explored in #3321, which instead changed the types to match the broken runtime (
PoolConnection extends BaseConnection). That would force a breaking change for everyone depending on theConnectiontype.This PR takes the opposite direction: fix the runtime so types remain correct.