Always call Hub.OnDisconnectedAsync with an Exception when a client disconnects ungracefully
Open
affected-medium
area-signalr
bug
severity-minor
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
In some cases (based on reports to the "ASP.NET Discussions" mailing list), Hub.OnDisconnectedAsync can be called without an Exception when SignalR clients disconnect ungracefully.
One way to remove ambiguity between graceful and ungraceful disconnects would be to send a CloseMessage from the SignalR client to the server before it gracefully closes the connection. The absence of a CloseMessage would then be enough for the server to know the client disconnected ungracefully and pass an Exception to Hub.OnDisconnectedAsync.
We already do this in the other direction when the SignalR server closes the connection.
Contributor guide
Assessment
This issue has not been assessed yet.