dotnet / dotnet/aspnetcore

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

Open
#26,701 18 comments 0 reactions 1 assignee Claimed by @BrennanConroy View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.