fix(router): prevent error handling when injector is destroyed#59457
fix(router): prevent error handling when injector is destroyed#59457arturovt wants to merge 1 commit intoangular:mainfrom
Conversation
444f4bc to
e3d918e
Compare
|
If the injector is already destroyed, that error is still caught by the Edit: This change also isn't quite equivalent to the previous state because you're missing the |
|
The issue is that |
|
If the application is already destroyed, the catch block should not execute anything in practice (because other stuff has already been released and destroyed). |
Okay, yea that's fair. I would reframe the justification for this. It's not exactly that we don't want to do That said, I'm still not sure whether we should omit the event and the promise completion and only return |
|
Alright, maybe we should wrap the code with if Btw, the |
Yea, let's do
👍 |
|
👍 will update the code tomorrow. |
In this commit, we prevent error handling when the root injector is already destroyed. This may happen when the observable completes before emitting a value, which would trigger a `catchError` block that attempts to call `runInInjectionContext` on a destroyed injector.
e3d918e to
ddfa390
Compare
|
@atscott updated the code to include |
|
FYI, removing the "merge" label for now, since we'd need to run a global presubmit for this change. We'll re-add the "merge" label back if the presubmit is successful. |
|
TGP is green. |
|
This PR was merged into the repository by commit c7b6e11. The changes were merged into the following branches: main, 19.1.x |
In this commit, we prevent error handling when the root injector is already destroyed. This may happen when the observable completes before emitting a value, which would trigger a `catchError` block that attempts to call `runInInjectionContext` on a destroyed injector. PR Close #59457
…ar#59457) In this commit, we prevent error handling when the root injector is already destroyed. This may happen when the observable completes before emitting a value, which would trigger a `catchError` block that attempts to call `runInInjectionContext` on a destroyed injector. PR Close angular#59457
|
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. |
In this commit, we prevent error handling when the root injector is already destroyed. This may happen when the observable completes before emitting a value, which would trigger a
catchErrorblock that attempts to callrunInInjectionContexton a destroyed injector.