Skip to content

fix(router): should run resolvers for the same route concurrently - #15499

Merged
alxhub merged 1 commit into
angular:masterfrom
DzmitryShylovich:gh/14279
Jul 18, 2017
Merged

alxhub merged 1 commit into
angular:masterfrom
DzmitryShylovich:gh/14279

Conversation

@DzmitryShylovich

@DzmitryShylovich DzmitryShylovich commented Mar 26, 2017 •

Copy link
Copy Markdown
Contributor

Fixes #14279

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 resolvers should be enough.
May be the second should complete the first and then we do not have to play with timings.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed the 3rd resolver

vicb
vicb previously requested changes Mar 28, 2017

@vicb vicb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please address the comments.

Also waitForMap is called twice in the code base. Could it cause concurrency issue when loading child config (ie if both use the loadChildren) ?

@vicb vicb added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Mar 28, 2017
@DzmitryShylovich

Copy link
Copy Markdown
Contributor Author

Also waitForMap is called twice in the code base. Could it cause concurrency issue when loading child config (ie if both use the loadChildren) ?

probably yes, so I decided not to use it at all. It's more readable without waitForMap + faster (we don't need to loop 2 times).

May be the second should complete the first and then we do not have to play with timings.

Don't think it's a good idea. Consider such test but without the fix (resolvers run sequentially). resolver1 will never complete because resolver2 will never run (deadlock). So to fail such test we will need to introduce a timeout. Plus we need to add the second should complete the first logic. Sounds like overhead to me.

@vicb

vicb commented Mar 29, 2017

Copy link
Copy Markdown
Contributor

So to fail such test we will need to introduce a timeout.

Jasmine will timeout by default (you can override the default timeout with a shorter one).

@vicb

vicb commented Mar 29, 2017

Copy link
Copy Markdown
Contributor

the second should complete the first

should be trivial ?

@DzmitryShylovich

Copy link
Copy Markdown
Contributor Author

@vicb updated. it's a little bit more code but it's sync now 馃槂

@jasonaden
jasonaden dismissed vicb鈥檚 stale review July 14, 2017 00:27

It's been addressed

@jasonaden
jasonaden self-requested a review July 14, 2017 00:27

@jasonaden jasonaden left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@jasonaden jasonaden added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Jul 14, 2017
@alxhub
alxhub merged commit ad3029e into angular:master Jul 18, 2017
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 12, 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 area: router cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run multiple resolvers concurrently in router.

5 participants