Hope this helps When to remove a connection from a group depends on your specific scenario. For example, you may want to remove the connection from a group when the user navigates away from a page, etc. But group membership does not persist across different connections. This means you don't need to manually leave groups when you disconnect a SignalR connection. When you disconnect (whether intentional or due to an error), all memberships in groups will be lost. Quoting Microsoft Docs:
public void JoinGroup(string groupName)
Hope that helps The group management methods (add and remove) are async. If you don't await the returned task then send to the group immediately after you have a race condition such that the client you just added might not receive the message. Also, you should never call .Wait() from in a hub method. Make the hub method async and await it instead.
To fix the issue you can do Joining to a group is a server side thing. You need to create a hub method (server side) that adds a connection to a group and then invoke this hub method from the client. Take a look at this article for more details.