Avoid stack overflow when logging exceptions in Blazor WebAssembly#25464
Merged
EngincanV merged 1 commit intoMay 26, 2026
Merged
Conversation
Filter out UserExceptionInformer category from AbpExceptionHandlingLoggerProvider so logs written by the informer do not re-enter the same provider, which previously caused infinite recursion and a browser stack overflow. Fixes #25463
1 task
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a Blazor WebAssembly logging recursion where exceptions forwarded to IUserExceptionInformer.Inform are re-logged by UserExceptionInformer, re-entering AbpExceptionHandlingLoggerProvider until the browser stack overflows.
Changes:
- Filters out the
UserExceptionInformerlog category forAbpExceptionHandlingLoggerProviderduring WebAssembly module logging setup to prevent re-entrancy loops. - Adds a regression test ensuring an informer writing to the same logging pipeline does not cause recursion.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| framework/test/Volo.Abp.AspNetCore.Components.Web.Theming.Tests/Volo/Abp/AspNetCore/Components/Web/ExceptionHandling/AbpExceptionHandlingLogger_Tests.cs | Adds a regression test that reproduces the recursion scenario and asserts it’s prevented by category filtering. |
| framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpAspNetCoreComponentsWebAssemblyModule.cs | Applies a provider-specific category filter to exclude UserExceptionInformer logs from the exception-handling provider, preventing infinite recursion. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## rel-10.4 #25464 +/- ##
============================================
+ Coverage 49.39% 49.42% +0.02%
============================================
Files 3670 3670
Lines 123594 123599 +5
Branches 9452 9453 +1
============================================
+ Hits 61055 61084 +29
+ Misses 60705 60676 -29
- Partials 1834 1839 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
EngincanV
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #25463
AbpExceptionHandlingLoggerProvideris registered in the MEL pipeline by the WebAssembly module so that anyError/Criticallog with an exception is forwarded toIUserExceptionInformer.Informfor UI display. The defaultUserExceptionInformer.LogExceptionthen writes the same exception back throughILogger<UserExceptionInformer>, which re-enters the same provider and recurses until the browser stack overflows.Filter out the
UserExceptionInformercategory fromAbpExceptionHandlingLoggerProviderat registration time so the informer's own log writes do not loop back into the provider. Other logger providers (console, Serilog, etc.) still receive these log records.