Skip to content

fix(core): close named registerAsync connections on shutdown - #2455

Merged
willsoto merged 6 commits into
mainfrom
fix/async-shutdown-name
Nov 1, 2026
Merged

willsoto merged 6 commits into
mainfrom
fix/async-shutdown-name

Conversation

@willsoto

@willsoto willsoto commented Nov 1, 2026

Copy link
Copy Markdown
Owner
  • Named registerAsync connections are now closed on shutdown even when the options factory returns a different (or no) name; the registerAsync name always wins.
  • register also provides the base model under OBJECTION_BASE_MODEL, matching registerAsync. The class token is kept.
  • Merges the async provider helpers, removing an unreachable validation branch.
  • Re-enables two long-skipped integration tests and adds shutdown and public-API registerAsync/forFeature coverage.
  • README no longer tells users to repeat the connection name inside the factory.

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.
@willsoto
willsoto merged commit 9084153 into main Nov 1, 2026
1 check passed
@willsoto
willsoto deleted the fix/async-shutdown-name branch November 1, 2026 17:11
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