nest
nest copied to clipboard
fix(core): dependencies not resolving for transient lazy providers
trafficstars
PR Checklist
Please check if your PR fulfills the following requirements:
- [x] The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
- [x] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
PR Type
What kind of change does this PR introduce?
- [x] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Other... Please describe:
What is the current behavior?
Issue Number: Closes #13761
When a lazy module resolver a lazy provider marked as transient the singleton dependencies are recreated for the new requests in same context.
What is the new behavior?
Skipping creation of new providers if they are marked as transient and have annotation in the score of module.
Does this PR introduce a breaking change?
- [ ] Yes
- [x] No
Other information
Pull Request Test Coverage Report for Build ed614f3a-8fae-4c99-8c8e-2e6bfea98225
Details
- 2 of 3 (66.67%) changed or added relevant lines in 1 file are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage decreased (-0.01%) to 92.198%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| packages/core/injector/module.ts | 2 | 3 | 66.67% |
| <!-- | Total: | 2 | 3 |
| Totals | |
|---|---|
| Change from base Build 7ea6f01d-9fcc-4d6c-90b4-f217d2306325: | -0.01% |
| Covered Lines: | 6748 |
| Relevant Lines: | 7319 |
💛 - Coveralls
LGTM