Repository navigation
fix(core): close named registerAsync connections on shutdown - #2455
Merged
Merged
Conversation
The connection provider is registered under the name passed to registerAsync, but disconnect looked it up using the name returned by the options factory. When the two differed, shutdown threw and the connection was left open. The async options now always carry the registerAsync name.
createAsyncOptionsProvider re-validated options that createAsyncProviders had already rejected, so its throw was unreachable. Validating once in a single helper removes it.
register only exposed the base model under its class token while registerAsync used OBJECTION_BASE_MODEL, so the same injection did not work for both. register now provides both tokens.
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.
registerAsyncconnections are now closed on shutdown even when the options factory returns a different (or no)name; theregisterAsyncname always wins.registeralso provides the base model underOBJECTION_BASE_MODEL, matchingregisterAsync. The class token is kept.registerAsync/forFeaturecoverage.