I created a basic Blazor Server-Side chat, but OnDisconnectedAsync is never called, the connection stays alive even when the browser is closed.
The OnDisconnectAsync method is inside the ChatHub.cs:
public override async Task OnDisconnectedAsync(Exception exception)
{
Debug.WriteLine("Disconnected");
}
The same code works if Blazor WebAssembly is used instead. I can't understand if this is a bug or there is something I'm missing.