Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): ensure takeUntilDestroyed unregisters onDestroy listener on unsubscribe #49901

Conversation

skrtheboss
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

The takeUntilDestroyed function does not remove onDestroy listener on unsubscribe.

What is the new behavior?

The takeUntilDestroyed function removes onDestroy listener on unsubscribe.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@jessicajaniuk jessicajaniuk added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews action: review The PR is still awaiting reviews from at least one requested reviewer area: core Issues related to the framework runtime target: rc This PR is targeted for the next release-candidate labels Apr 18, 2023
@ngbot ngbot bot added this to the Backlog milestone Apr 18, 2023
@AndrewKushnir AndrewKushnir requested review from atscott and pkozlowski-opensource and removed request for AndrewKushnir April 18, 2023 18:30
Copy link
Contributor

@atscott atscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! A couple nits but overall LGTM

packages/core/rxjs-interop/src/take_until_destroyed.ts Outdated Show resolved Hide resolved
@skrtheboss skrtheboss force-pushed the fix/ensure-take-until-destroyed-unregisters-on-destroy-listener-on-unsubscribe branch from 979f3e3 to 37c7731 Compare April 19, 2023 06:49
@skrtheboss
Copy link
Contributor Author

HI @atscott, thank you for the feedback.
I have implemented the suggestions you have made.
Let me know if there is something else I should change.

@skrtheboss skrtheboss force-pushed the fix/ensure-take-until-destroyed-unregisters-on-destroy-listener-on-unsubscribe branch from 37c7731 to dd217a3 Compare April 19, 2023 06:51
…n unsubscribe

The takeUntilDestroyed must always remove the onDestroy listener,
in the teardown logic.
@skrtheboss skrtheboss force-pushed the fix/ensure-take-until-destroyed-unregisters-on-destroy-listener-on-unsubscribe branch from dd217a3 to 2056b03 Compare April 19, 2023 07:04
@atscott atscott 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 action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 19, 2023
@jessicajaniuk jessicajaniuk removed the request for review from pkozlowski-opensource April 19, 2023 19:42
@angular-robot
Copy link
Contributor

angular-robot bot commented Apr 19, 2023

This PR was merged into the repository by commit c029c67.

@angular-robot angular-robot bot closed this in c029c67 Apr 19, 2023
angular-robot bot pushed a commit that referenced this pull request Apr 19, 2023
…n unsubscribe (#49901)

The takeUntilDestroyed must always remove the onDestroy listener,
in the teardown logic.

PR Close #49901
@skrtheboss skrtheboss deleted the fix/ensure-take-until-destroyed-unregisters-on-destroy-listener-on-unsubscribe branch April 19, 2023 20:52
@angular-automatic-lock-bot
Copy link

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 May 20, 2023
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: core Issues related to the framework runtime target: rc This PR is targeted for the next release-candidate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants