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

Skip to content

fix(core): Catch and report rejections in async function of `PendingT… #60044

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
wants to merge 1 commit into from

Conversation

atscott
Copy link
Contributor

@atscott atscott commented Feb 21, 2025

…asks.run`

This commit ensures that rejections of the promise of the async function passed to PendingTasks.run are not dangling and get reported to the application error handler. This prevents what would likely be a common dangling promise that could end up crashing the node process.

BREAKING CHANGE: PendingTasks.run no longer returns the result of the async function. If this behavior is desired, it can be re-implemented manually with the PendingTasks.add. Be aware, however, that promise rejections will need to be handled or they can cause the node process to shut down when using SSR.

@atscott atscott added area: core Issues related to the framework runtime target: major This PR is targeted for the next major release labels Feb 21, 2025
@ngbot ngbot bot modified the milestone: Backlog Feb 21, 2025
@angular-robot angular-robot bot added the detected: breaking change PR contains a commit with a breaking change label Feb 21, 2025
@atscott atscott requested a review from alxhub February 21, 2025 00:35
…asks.run`

This commit ensures that rejections of the promise of the async function
passed to `PendingTasks.run` are not dangling and get reported to the
application error handler. This prevents what would likely be a common
dangling promise that could end up crashing the node process.

BREAKING CHANGE: `PendingTasks.run` no longer returns the result of the
async function. If this behavior is desired, it can be re-implemented
manually with the `PendingTasks.add`. Be aware, however, that promise rejections
will need to be handled or they can cause the node process to shut down
when using SSR.
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

@pullapprove pullapprove bot requested a review from mmalerba February 26, 2025 22:54
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

@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Feb 27, 2025
@mmalerba
Copy link
Contributor

mmalerba commented Mar 3, 2025

This PR was merged into the repository by commit 7232ce5.

The changes were merged into the following branches: main

@mmalerba mmalerba closed this in 7232ce5 Mar 3, 2025
@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 Apr 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 detected: breaking change PR contains a commit with a breaking change target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants