You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Application crash observed in a production environment.
From Windows Event Viewer:
Application: w3wp.exe
CoreCLR Version: 4.700.20.26901
.NET Core Version: 3.1.5
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ObjectDisposedException: Cannot process pending renders after the renderer has been disposed.
Object name: 'Renderer'.
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessPendingRender()
at Microsoft.AspNetCore.Components.RenderTree.Renderer.AddToRenderQueue(Int32 componentId, RenderFragment renderFragment)
at Microsoft.AspNetCore.Components.ComponentBase.StateHasChanged()
at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.<>c.b__8_0(Object state)
--- End of stack trace from previous location where exception was thrown ---
at Blazored.Toast.BlazoredToast.CalculateProgress(Int32 percentComplete)
at System.Threading.Tasks.Task.<>c.b__139_1(Object state)
at System.Threading.QueueUserWorkItemCallback.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
To Reproduce
I haven't personally reproduced it, but it appears that the component being asked to be rerendered has been disposed when CalculateProgress attempts to call StateHasChanged.
Expected behavior
Exception caught and ignored.
Hosting Model (is this issue happening with a certain hosting model?):
Blazor Server
The text was updated successfully, but these errors were encountered:
I am not sure what additional information is needed.
The failure happens when an Exception occurs when calling the following line in CalculateProgress of BlazoredToast.cs: await InvokeAsync(StateHasChanged);
This appears to occur when the component creating a toast has its renderer disposed as referenced by the exception provided (e.g. toast is being displayed, user closes the browser tab, component starts to be disposed, and then CalculateProgress is called). Crashing the application can be simulated by adding an Exception in CalculateProgress. To reproduce this normally, one would have to be able to guarantee that the renderer for the component is disposed prior to the CalculateProgress method being called and possibly before some other part of the component from being disposed which might prevent the method from being called at all (i.e. I am not sure if the Timer used will be disposed at some point as well or if it always gets to invoke the callback).
Describe the bug
Application crash observed in a production environment.
From Windows Event Viewer:
To Reproduce
I haven't personally reproduced it, but it appears that the component being asked to be rerendered has been disposed when CalculateProgress attempts to call StateHasChanged.
Expected behavior
Exception caught and ignored.
Hosting Model (is this issue happening with a certain hosting model?):
The text was updated successfully, but these errors were encountered: