Skip to content

OnConnectedAsync & OnDisconnectedAsync not being called on startconnection  #277

Description

@Bresic

We have a .NET 6 project using Azure.SignalR (v. 1.25.2) and an Angular 16 FE.

We created two hubs (x and y).
We are sending images through SignalR, and it works fine, the images are transported through the devices correctly, but when we are establishing the connections, the OnConnectedAsync is not called (to be precise, it's being called randomly, a few times out of many).

In reality, the connection is made - in the Chrome console, I can see that the web socket is connected, and as I said we can transfer the images easily.

The issue is that we are managing a dictionary with the users connected to the hub and this dictionary is being handled in the OnConnectedAsync & OnDisconnectedAsync. Because these methods are not being invoked for some reason, our UI is showing a false negative message when a user wants to see if someone is connected to get the images.

this.hubConnection = new HubConnectionBuilder()
.withUrl(hubUrl, transportType)
.withAutomaticReconnect([2, 3, 3, 3, 3])
.build();

I could see 2 similar issues on github, but not 100% the same, as they had issue sending things through their SignalR, while we don't have that, we can send our data correctly, but the methods are just not being invoked.

The same issue persists if we use the old SignalR, not the Azure one.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions