Open
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
namespace Microsoft.AspNetCore.Components.Server.Circuits;
public class BlazorCircuitHandler() : CircuitHandler
{
public override async Task OnCircuitOpenedAsync(Circuit circuit, CancellationToken cancellationToken)
{
await Task.Delay(2000);
await base.OnCircuitOpenedAsync(circuit, cancellationToken);
}
public override async Task OnCircuitClosedAsync(Circuit circuit, CancellationToken cancellationToken)
{
await base.OnCircuitClosedAsync(circuit, cancellationToken);
}
}
A lot of people use custom Blazor Server CircuitHandler implementations for initializing user state, connecting to SignalR Hubs, etc.
As seen in the video below, if you load a page with an InteractiveServer component, and navigate away before the circuit is opened, the whole circuit breaks. Thus, the whole app breaks.
Expected Behavior
This would be solved with #55127, because enhanced navigation would reopen the broken connection.
Steps To Reproduce
Add custom circuit handler implementation to services
Screen.Recording.2024-12-30.at.2.03.27.AM.mov
Exceptions (if any)
No response
.NET Version
9.0.100
Anything else?
No response
Activity