fix(common): clean up `urlChanges` subscribers when root scope is destroyed by arturovt · Pull Request #59703 · angular/angular · GitHub
Skip to content

fix(common): clean up urlChanges subscribers when root scope is destroyed - #59703

Closed
arturovt wants to merge 1 commit into
angular:mainfrom
arturovt:fix/common-upgrade-location-shim-complete-urlChanges
Closed

arturovt wants to merge 1 commit into
angular:mainfrom
arturovt:fix/common-upgrade-location-shim-complete-urlChanges

Conversation

@arturovt

Copy link
Copy Markdown
Contributor

In this commit, the urlChanges subject is completed to release all active observers when the root scope is destroyed. Previously, subscribing to the urlChanges subject caused the subscriber to capture this, resulting in a memory leak after the root scope was destroyed.

@pullapprove
pullapprove Bot requested a review from devversion January 24, 2025 14:41
@angular-robot angular-robot Bot added the area: common Issues related to APIs in the @angular/common package label Jan 24, 2025
@ngbot ngbot Bot added this to the Backlog milestone Jan 24, 2025
@arturovt
arturovt force-pushed the fix/common-upgrade-location-shim-complete-urlChanges branch from 602ad16 to 9155c8d Compare January 24, 2025 22:39
@devversion devversion added target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker labels Jan 27, 2025
Comment thread packages/common/upgrade/src/location_shim.ts Outdated
@devversion devversion added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: merge The PR is ready for merge by the caretaker labels Jan 27, 2025
@arturovt
arturovt force-pushed the fix/common-upgrade-location-shim-complete-urlChanges branch from 9155c8d to bd96ff1 Compare January 27, 2025 18:51
@arturovt

Copy link
Copy Markdown
Contributor Author

@arturovt
arturovt force-pushed the fix/common-upgrade-location-shim-complete-urlChanges branch 2 times, most recently from 04366fa to bb3d59f Compare February 4, 2025 15:49
@arturovt
arturovt force-pushed the fix/common-upgrade-location-shim-complete-urlChanges branch from bb3d59f to 61948c1 Compare February 13, 2025 17:13
@devversion devversion 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 Feb 13, 2025
@ngbot

ngbot Bot commented Feb 13, 2025

Copy link
Copy Markdown

I see that you just added the action: merge label, but the following checks are still failing:
    failure status "pullapprove" is failing
    pending status "google-internal-tests" is pending

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken main, please try rebasing to main and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@thePunderWoman thePunderWoman added target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker and removed target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker labels Feb 13, 2025
@thePunderWoman

Copy link
Copy Markdown
Contributor

@arturovt Can you rebase this? There are some tests failing, but I suspect they're just out of date / unrelated.

@thePunderWoman thePunderWoman added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: merge The PR is ready for merge by the caretaker labels Feb 14, 2025
@arturovt
arturovt force-pushed the fix/common-upgrade-location-shim-complete-urlChanges branch from 61948c1 to 71e7422 Compare February 15, 2025 06:21
@arturovt

Copy link
Copy Markdown
Contributor Author

@arturovt Can you rebase this? There are some tests failing, but I suspect they're just out of date / unrelated.

Done.

…troyed

In this commit, the `urlChanges` subject is completed to release all active observers when the root scope is destroyed. Previously, subscribing to the `urlChanges` subject caused the subscriber to capture `this`, resulting in a memory leak after the root scope was destroyed.
@arturovt
arturovt force-pushed the fix/common-upgrade-location-shim-complete-urlChanges branch from 71e7422 to 624ff0d Compare February 15, 2025 06:37
@angular-robot
angular-robot Bot requested a review from devversion February 15, 2025 06:37
@devversion devversion 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 Feb 17, 2025
thePunderWoman pushed a commit that referenced this pull request Feb 18, 2025
…troyed (#59703)

In this commit, the `urlChanges` subject is completed to release all active observers when the root scope is destroyed. Previously, subscribing to the `urlChanges` subject caused the subscriber to capture `this`, resulting in a memory leak after the root scope was destroyed.

PR Close #59703
@thePunderWoman

Copy link
Copy Markdown
Contributor

This PR was merged into the repository by commit 7bd4be0.

The changes were merged into the following branches: main, 19.1.x

@arturovt
arturovt deleted the fix/common-upgrade-location-shim-complete-urlChanges branch February 18, 2025 18:03
@angular-automatic-lock-bot

Copy link
Copy Markdown

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Mar 21, 2025
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: common Issues related to APIs in the @angular/common package target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants