Is there any expiration of User-Group mapping membership in SignalR Serverless mode?

Gabriel Ferreira 0 Reputation points
2023-10-18T18:24:48.2+00:00

I'm testing adding a User to a Group in SignalR. When I add it, new messages sent to the group will be received by any active Connection from the added User.

If I restart the application and establish a new Connection to SignalR, the previous configuration (added the User to the Group) is still maintained, and the Connection from the User will continue to receive messages from the Group, even if I don't "re-add" the User again to the Group.

But, the documentation states:

Group membership isn't preserved when a connection reconnects. The connection needs to rejoin the group when it's re-established.

So I got confused whether the membership of a User into a Group is or not maintained by SignalR -- and if there are some expiration time where the application should need to re-add the User to the Group again.

Azure SignalR Service
Azure SignalR Service
An Azure service that is used for adding real-time communications to web applications.
146 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 16,506 Reputation points Microsoft Employee
    2023-10-18T23:31:56.8933333+00:00

    @Gabriel Ferreira In SignalR Serverless mode, the group membership is maintained as long as the connection is active. If the connection is lost and re-established, the group membership is not preserved, and the connection needs to rejoin the group. However, if the connection is still active, the group membership is maintained even if the application is restarted.

    Regarding the expiration time of the User-Group mapping membership, there is no expiration time in SignalR Serverless mode. The membership is maintained as long as the connection is active.

    The documentation you mentioned is for SignalR in general, and it may not apply to SignalR Serverless mode. In SignalR Serverless mode, the group membership is maintained as long as the connection is active, and there is no need to re-add the User to the Group again.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.