Skip to content

fix(core): avoid eager providers re-initialization #23559

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

Closed
wants to merge 1 commit into from

Conversation

vikerman
Copy link
Contributor

Fix a corner case where eager providers were getting constructed twice if the provider was requested before the initialization of the NgModule is complete.

PR Checklist

Please check if your PR fulfills the following requirements:

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
[ ] Documentation content changes
[ ] angular.io application / infrastructure changes
[ ] Other... Please describe:

Does this PR introduce a breaking change?

[] Yes
[x] No

@vikerman vikerman requested a review from alxhub April 26, 2018 13:30
@vikerman vikerman force-pushed the eager-providers-fix branch 2 times, most recently from 14cf75b to 63754eb Compare April 26, 2018 13:33
@vikerman vikerman added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Apr 26, 2018
@mary-poppins
Copy link

You can preview 63754eb at https://pr23559-63754eb.ngbuilds.io/.

@@ -68,7 +68,9 @@ export function initNgModule(data: NgModuleData) {
for (let i = 0; i < def.providers.length; i++) {
const provDef = def.providers[i];
if (!(provDef.flags & NodeFlags.LazyProvider)) {
providers[i] = _createProviderInstance(data, provDef);
if (providers[i] === undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a comment

Fix a corner case where eager providers were getting constructed twice if the provider was requested before the initialization of the NgModule is complete.
@vikerman vikerman force-pushed the eager-providers-fix branch from 63754eb to 961e19f Compare April 26, 2018 18:37
@mary-poppins
Copy link

You can preview 961e19f at https://pr23559-961e19f.ngbuilds.io/.

@vikerman vikerman added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 26, 2018
@ngbot
Copy link

ngbot bot commented Apr 26, 2018

I see that you just added the PR action: merge label, but the following checks are still failing:
    failure status "continuous-integration/travis-ci/pr" is failing

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

IgorMinar pushed a commit that referenced this pull request Apr 27, 2018
Fix a corner case where eager providers were getting constructed twice if the provider was requested before the initialization of the NgModule is complete.

PR Close #23559
@IgorMinar IgorMinar closed this in 0c6dc45 Apr 27, 2018
IgorMinar pushed a commit that referenced this pull request Apr 27, 2018
Fix a corner case where eager providers were getting constructed twice if the provider was requested before the initialization of the NgModule is complete.

PR Close #23559
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants