OnConnectedAsync and OnDisconnectedAsync are not invoked when a client application attempts to establish signalR connection
See original GitHub issueDescribe the bug
Create a signalR server application, derive a class from Hub class and override OnConnectedAsync and OnDisconnectedAsync in the derived class. Log some distinctive texts upon raising either of those events to ensure that you can track when they are raised. When a signalR client application like an angular application attempts to establish a connection, OnConnectedAsync may not raise in signalR server’s side. If that happens, OnDisconnectedAsync won’t raise too at disconnection attempt. This issue is intermittent but it happens noticeably. This issue’s frequency increases when the singalR server is using Azure’s SignalR Services.
To Reproduce
Steps to reproduce the behavior:
- Using this version of ASP.NET Core 2.2.
- Follow the instructions above to setup a client and server application. Try both C# client and angular client applications.
Expected behavior
OnConnectedAsync and OnDisconnectedAsync events should be raised consistently upon establishing or disconnecting connections.
Issue Analytics
- State:
- Created 5 years ago
- Comments:32 (11 by maintainers)
Top Related StackOverflow Question
Not sharing the same Azure SignalR Service instance between two hubs resolved the issue.
@BrennanConroy I opened a separate issue to report type 7 issue. The issue is found here: https://github.com/aspnet/AspNetCore/issues/7020