fix(router): complete router events on dispose#59327
fix(router): complete router events on dispose#59327arturovt wants to merge 1 commit intoangular:mainfrom
events on dispose#59327Conversation
|
It looks like this is breaking internally so it'll likely break users externally too. The problem is that if someone is subscribing using the |
|
@crisbeto what do you think if we call |
|
We can try it out to see if it breaks anything internally. |
In this commit, we manually complete the `events` subject to remove all active observers and enable granular garbage collection, as users may forget to unsubscribe manually when subscribing to `router.events`.
6d99a04 to
054cc44
Compare
|
Changed to |
|
This time there were only two test failures on a global run, although I'm not quite sure why it's failing. Here's the stack trace: Interestingly, these tests pass if I switch the |
|
Seems like the subscription happens after the router is disposed (the root injector is destroyed)... |
|
I've sent out a fix for the problematic test. Once it lands, I'll re-run all the tests to make sure that nothing else regressed. |
|
I'm bumping it to the minor branch just in case some external apps depend on subscribing after destroy. |
|
This PR was merged into the repository by commit 52a6710. The changes were merged into the following branches: main |
|
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 manually complete the `events` subject to remove all active observers and enable granular garbage collection, as users may forget to unsubscribe manually when subscribing to `router.events`. PR Close angular#59327
In this commit, we manually complete the
eventssubject to remove all active observers and enable granular garbage collection, as users may forget to unsubscribe manually when subscribing torouter.events.