Skip to content

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

Closed
atscott wants to merge 1 commit intoangular:mainfrom
atscott:pendingtaskvoid
Closed

fix(core): Catch and report rejections in async function of `PendingT…#60044
atscott wants to merge 1 commit intoangular:mainfrom
atscott:pendingtaskvoid

Conversation

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