Skip to content
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

RouterOutlet loads component 2x in a race condition #7497

Closed
tbosch opened this issue Mar 9, 2016 · 3 comments
Closed

RouterOutlet loads component 2x in a race condition #7497

tbosch opened this issue Mar 9, 2016 · 3 comments

Comments

@tbosch
Copy link
Contributor

tbosch commented Mar 9, 2016

RouterOutlet#reuse checks if there is no current _componentRef and in that case creates a new component.
However, _componentRef is not set until the call to DynamicComponentLoader.loadNextToLocation is finished (in RouterOutlet#activate). If that call takes a bit longer (e.g. loading an html file from the server) RouterOutlet will create 2 instances of the component.

On my branch for codegen templates that changes the timing of DynamicComponentLoading a bit, the test for syncRoutesWithDynamicComponents (in sync_route_spec_impl.ts) fails because of this.

@tbosch
Copy link
Contributor Author

tbosch commented Mar 9, 2016

Setting to P1 as the issue the commit that introduced this logic was marked as P0... (#7318)

@naomiblack
Copy link
Contributor

@mhevery can you figure out who should work on this one? It seems to be related to #7318. Tests for the codegen branch are failing because of this issue.

@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 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants