question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When OnDisconnect is invoked, there is no Exception passed through.

See original GitHub issue

Describe the bug

When that OnDisconnect method is called, it appears as though there is no Exception passed through, so there’s no way to differentiate between a user that has just closed their browser, or a user that has been experiencing connectivity issues. SignalR for .NET Framework would pass through a boolean informing the server that it was as a result of a timeout.

To Reproduce

Exceptions (if any)

Further technical details

  • Your Azure SignalR SDK version
  • Your Server ASPNETCORE version or Assembly version of Microsoft.AspNetCore.SignalR
  • Your SignalR Client SDK version

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vicancycommented, May 13, 2022

Sorry for the late response.

differentiate client disconnection due to closing their browser vs a client losing their internet connection

When client “loses internet connection”, SignalR hub leverages the SignalR client ping messages to determine if the client is still there, however SignalR swallows the OperationCancelledException https://github.com/dotnet/aspnetcore/blob/88ee825bca9978df7f1d8c8c09b71b6dffeeb53b/src/SignalR/server/Core/src/HubConnectionHandler.cs#L169 and as a result it fails to differentiate from these 2 conditions and here is the issue https://github.com/dotnet/aspnetcore/issues/26701

In such a scenario, the Azure SignalR acts as a proxy and there is little Azure SignalR can do to change the behavior in SignalR application layer.

1reaction
terencefancommented, Sep 6, 2021

I’ll see if SignalR protocol could support this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java URL doesn't seem to connect, but no exception thrown
You have opened the connection but not closed it. To request that the HttpURLConnection be closed, you should call its disconnect() method.
Read more >
Use hubs in SignalR for ASP.NET Core
All.SendAsync(...) can fail if it's called without await and the hub method completes before SendAsync finishes.
Read more >
Invoke - AWS Lambda
Invokes a Lambda function. You can invoke a function synchronously (and wait for the response), or asynchronously. By default, Lambda invokes your function ......
Read more >
Error Messages — SQLAlchemy 2.0 Documentation
Exception raised for errors that are related to the database itself, and not the interface or data being passed. This error is a...
Read more >
Process | Node.js v20.5.1 Documentation
The listener callback function is invoked with the value of process.exitCode passed as the only argument. The 'beforeExit' event is not emitted for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found