-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Unnecessary calls to retrieve and shouldAttach in RouteReuseStrategy #23162
Copy link
Copy link
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: routerfreq3: highrouter: RouteReuseStrategystate: needs more investigationtype: bug/fix
Milestone
Description
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
When the first route is rendered. It has unnecessary calls to retrieve, even when shouldReuseRoute returns true.
Expected behavior
It shouldn't run retrieve and shouldAttach at all. Apart from that, sequence of running these function is also wrong. shouldAttach should run first then retrieve. That's my understanding of course.
Minimal reproduction of the problem with instructions
- Open the stackblitz example
- Check the console logs.
- There are calls to retrieve and shouldAttach, which shouldn't be there at all
What is the motivation / use case for changing the behavior?
Environment
Angular version: 5.2.8
Browser:
- [x] Chrome (desktop) version 65.0.3325.181
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform: Mac
Others:
I am using CustomStrategy for RouteReuseStrategy, but it is exactly same as DefaultRouteReuseStrategy
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: routerfreq3: highrouter: RouteReuseStrategystate: needs more investigationtype: bug/fix