Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(core): release hasPendingTasks observers #59723

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

Closed

Conversation

arturovt
Copy link
Contributor

In this commit, we unsubscribe the hasPendingTasks subject to remove all active observers and enable granular garbage collection, as users may forget to unsubscribe manually when subscribing to isStable.

@pullapprove pullapprove bot requested a review from alxhub January 26, 2025 16:42
@angular-robot angular-robot bot added the area: core Issues related to the framework runtime label Jan 26, 2025
@ngbot ngbot bot added this to the Backlog milestone Jan 26, 2025
@arturovt arturovt force-pushed the fix/core-hasPendingTasks-unsubscribe branch from ca940de to e1bd64b Compare January 30, 2025 20:01
@arturovt arturovt force-pushed the fix/core-hasPendingTasks-unsubscribe branch from e1bd64b to 733de79 Compare February 13, 2025 17:13
@arturovt arturovt force-pushed the fix/core-hasPendingTasks-unsubscribe branch from 733de79 to d88e914 Compare February 20, 2025 22:28
@arturovt arturovt force-pushed the fix/core-hasPendingTasks-unsubscribe branch from d88e914 to e765e0a Compare March 5, 2025 17:10
@thePunderWoman thePunderWoman requested review from atscott and removed request for alxhub March 5, 2025 17:24
@thePunderWoman thePunderWoman added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Mar 5, 2025
@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Mar 5, 2025
@JeanMeche
Copy link
Member

From the tests' point of view, it looks like very breaking.

@atscott atscott 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 Mar 5, 2025
@thePunderWoman
Copy link
Contributor

Yeah, unfortunately this is exceptionally breaking.

@thePunderWoman
Copy link
Contributor

This unfortunately is not landable due to the breaking nature of this change. Sorry, @arturovt.

@JeanMeche JeanMeche reopened this Mar 5, 2025
@JeanMeche JeanMeche force-pushed the fix/core-hasPendingTasks-unsubscribe branch from e765e0a to dda22fe Compare March 5, 2025 18:56
@angular-robot angular-robot bot requested a review from atscott March 5, 2025 18:57
@JeanMeche JeanMeche force-pushed the fix/core-hasPendingTasks-unsubscribe branch from dda22fe to 50467bb Compare March 5, 2025 19:39
@JeanMeche JeanMeche force-pushed the fix/core-hasPendingTasks-unsubscribe branch 2 times, most recently from 25f9b55 to 590f396 Compare March 5, 2025 21:44
* In case the service is about to be destroyed, return a self-completing observable.
* Otherwise, return the observable that emits the current state of pending tasks.
*/
safeHasPendingTasks(): Observable<boolean> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's instead make pendingTasks private and expose hasPendingTasks as the value and hasPendingTasksObservable as the observable version. There's no need to have a public "safeHasPendingTasks" along with an unsafe one that might bite your hand off.

@JeanMeche JeanMeche force-pushed the fix/core-hasPendingTasks-unsubscribe branch 2 times, most recently from 8c3d1d2 to df3c4ee Compare March 6, 2025 00:52
@JeanMeche JeanMeche force-pushed the fix/core-hasPendingTasks-unsubscribe branch from df3c4ee to eb17e98 Compare March 9, 2025 23:16
@pullapprove pullapprove bot requested a review from atscott March 12, 2025 17:56
@thePunderWoman
Copy link
Contributor

@arturovt Looks like this still has real failing tests. Can you address them?

In this commit, we unsubscribe the `hasPendingTasks` subject to remove all active observers and enable granular garbage collection, as users may forget to unsubscribe manually when subscribing to `isStable`.
@arturovt arturovt force-pushed the fix/core-hasPendingTasks-unsubscribe branch from eb17e98 to 1bc7d7e Compare April 2, 2025 15:36
@arturovt
Copy link
Contributor Author

arturovt commented Apr 2, 2025

@thePunderWoman fixed unit tests.

@thePunderWoman thePunderWoman removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Apr 2, 2025
Copy link
Contributor

@thePunderWoman thePunderWoman left a comment

Choose a reason for hiding this comment

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

reviewed-for: public-api, fw-general

Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

Reviewed-for: public-api

@thePunderWoman thePunderWoman added action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release and removed action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Apr 2, 2025
@thePunderWoman
Copy link
Contributor

This PR was merged into the repository by commit 1c7b356.

The changes were merged into the following branches: main

@arturovt arturovt deleted the fix/core-hasPendingTasks-unsubscribe branch April 2, 2025 19:24
@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 3, 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: core Issues related to the framework runtime target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants