Skip to content

Always call Hub.OnDisconnectedAsync with an Exception when a client disconnects ungracefully #26701

Open
@halter73

Description

@halter73

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.

Metadata

Metadata

Assignees

Labels

affected-mediumThis issue impacts approximately half of our customersarea-signalrIncludes: SignalR clients and serversbugThis issue describes a behavior which is not expected - a bug.severity-minorThis label is used by an internal tool

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions