Skip to content

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

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

fix(common): clean up urlChanges subscribers when root scope is destroyed#59703
arturovt wants to merge 1 commit intoangular: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
@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

@devversion I checked the angular.js code and you were right. I also left a comment for clarification.

@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
Copy link
Copy Markdown

ngbot bot commented Feb 13, 2025

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

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@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