Skip to content

fix(core): avoid injecting ErrorHandler from a destroyed injector #61886

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

@arturovt arturovt commented Jun 4, 2025

This commit prevents lazy injection of the internal ErrorHandler from a destroyed injector, as it would result in another "destroyed injector" error.

@pullapprove pullapprove bot requested a review from atscott June 4, 2025 23:52
@angular-robot angular-robot bot added the area: core Issues related to the framework runtime label Jun 4, 2025
@ngbot ngbot bot added this to the Backlog milestone Jun 4, 2025
@arturovt arturovt force-pushed the fix/avoid-errorHandler-inject branch from 464cf17 to 1c1bc54 Compare June 5, 2025 11:18
@arturovt arturovt force-pushed the fix/avoid-errorHandler-inject branch from 1c1bc54 to 1f55347 Compare June 5, 2025 17:11
@angular-robot angular-robot bot requested a review from atscott June 5, 2025 17:11
@atscott
Copy link
Contributor

atscott commented Jun 5, 2025

I'm not sure that swallowing the error is the correct behavior. If errors are happening in the application after it was destroyed, I don't know that the correct behavior is to swallow the error entirely.

@arturovt
Copy link
Contributor Author

arturovt commented Jun 5, 2025

Since the error handler isn’t available, can we re throw the error in a micro task or setTimeout?

@atscott
Copy link
Contributor

atscott commented Jun 5, 2025

Since the error handler isn’t available, can we re throw the error in a micro task or setTimeout?

Yea, I think that would be appropriate. I think setTimeout might be the better of the two

@arturovt arturovt force-pushed the fix/avoid-errorHandler-inject branch from 1f55347 to 20e744e Compare June 5, 2025 22:04
@arturovt arturovt force-pushed the fix/avoid-errorHandler-inject branch from 20e744e to 1a66a21 Compare June 5, 2025 23:13
@thePunderWoman thePunderWoman added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Jun 6, 2025
@thePunderWoman
Copy link
Contributor

@arturovt Looks like you have one failing test you'll need to fix.

@pkozlowski-opensource pkozlowski-opensource 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 Jun 6, 2025
@arturovt arturovt force-pushed the fix/avoid-errorHandler-inject branch from 1a66a21 to 613d146 Compare June 6, 2025 11:27
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.

Setting review to request changes so it doesn’t appear that I’ve approved

@arturovt arturovt force-pushed the fix/avoid-errorHandler-inject branch from 613d146 to f1e13e2 Compare June 6, 2025 12:40
@arturovt arturovt force-pushed the fix/avoid-errorHandler-inject branch from f1e13e2 to 1d437de Compare June 6, 2025 21:26
@arturovt arturovt requested a review from atscott June 11, 2025 20:47
This commit prevents lazy injection of the internal `ErrorHandler` from a destroyed injector, as it would result in another "destroyed injector" error.
@arturovt arturovt force-pushed the fix/avoid-errorHandler-inject branch from 1d437de to a0a7284 Compare June 18, 2025 12:48
@angular-robot angular-robot bot requested a review from atscott June 18, 2025 12:48
@arturovt
Copy link
Contributor Author

@atscott rebased the branch, can you approve the CI run?

@thePunderWoman thePunderWoman 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 Jun 24, 2025
@thePunderWoman thePunderWoman removed the request for review from atscott June 24, 2025 14:12
thePunderWoman pushed a commit that referenced this pull request Jun 24, 2025
…61886)

This commit prevents lazy injection of the internal `ErrorHandler` from a destroyed injector, as it would result in another "destroyed injector" error.

PR Close #61886
@thePunderWoman
Copy link
Contributor

This PR was merged into the repository by commit c4dd258.

The changes were merged into the following branches: main, 20.0.x

@arturovt arturovt deleted the fix/avoid-errorHandler-inject branch June 24, 2025 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants