fix(router): correctly deactivate children with componentless parent #40196
+120
−20
Conversation
3 tasks
During route activation, a componentless route will not have a context created for it, but the logic continues to recurse so that children are still activated. This can be seen here: https://github.com/angular/angular/blob/362f45c4bf1bb49a90b014d2053f4c4474d132c0/packages/router/src/operators/activate_routes.ts#L151-L158 The current deactivation logic does not currently account for componentless routes. This commit adjusts the deactivation logic so that if a context cannot be retrieved for a given route (because it is componentless), we continue to recurse and deactivate the children using the same `parentContexts` in the same way that activation does. Fixes angular#20694
mhevery
approved these changes
Jan 6, 2021
atscott
added a commit
that referenced
this issue
Jan 6, 2021
…40196) During route activation, a componentless route will not have a context created for it, but the logic continues to recurse so that children are still activated. This can be seen here: https://github.com/angular/angular/blob/362f45c4bf1bb49a90b014d2053f4c4474d132c0/packages/router/src/operators/activate_routes.ts#L151-L158 The current deactivation logic does not currently account for componentless routes. This commit adjusts the deactivation logic so that if a context cannot be retrieved for a given route (because it is componentless), we continue to recurse and deactivate the children using the same `parentContexts` in the same way that activation does. Fixes #20694 PR Close #40196
3 tasks
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
During route activation, a componentless route will not have a context created
for it, but the logic continues to recurse so that children are still
activated. This can be seen here:
angular/packages/router/src/operators/activate_routes.ts
Lines 151 to 158 in 362f45c
The current deactivation logic does not currently account for componentless routes.
This commit adjusts the deactivation logic so that if a context cannot
be retrieved for a given route (because it is componentless), we
continue to recurse and deactivate the children using the same
parentContextsin the same way that activation does.Fixes #20694
Fixes #40196
regular presubmit and global
additional integration tests. Compared with results from clean client and a second run from this PR, they have the same number of failures so these are likely pre-existing and/or flakes. Pending code approval, all g3 signs seem to indicate that this should be okay to merge.
The text was updated successfully, but these errors were encountered: