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.

Clients not receiving group messages, yet they're reported to be group members

See original GitHub issue

Describe the bug

We have a front-end web server that negotiates with SignalR for users and manages their group memberships. We also have a back-end service that is blindly firing events to various groups based on external events.

While everything is running, if I use the API to check if a test user is in a group that they should be in, SignalR says they are a member however they never receive messages sent to the group. But if I manually add the user using the MessagePublisher sample project, the client automatically starts receiving messages properly.

Are there any situations where SignalR would say a user is a member and yet they wouldn’t receive messages?

To Reproduce

Setup

  • Use Azure SignalR in Serverless mode.
  • Use Microsoft.Azure.SignalR.Management to manage hubs.
  • Have a client already connected with the userId and listening for messages.
    return ServiceManager.GenerateClientAccessToken(hubName, userId);
    

Steps

  1. Add user to UserGroup.
    await hub.UserGroups.AddToGroupAsync(userId, groupName, ct);
    
  2. Send message to Group from the backend.
    await hub.Clients.Group(groupName).SendCoreAsync(methodName, args, ct);
    
  3. Client doesn’t receive the message.

However, if I add the user to the group via a debug app or something else then the user starts receiving messages.

Further technical details

  • Microsoft.Azure.SignalR v1.5.1
  • Microsoft.Azure.SignalR.Management v1.5.1
  • @microsoft/signalr v3.1.10

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
wanlwanlcommented, Nov 25, 2020

Thanks for your repo. For now, the operations about user join/leave group are fire-and-forget. Too soon operation of leave then join group will cause the wierd status of the user in/out of some group. For now the workaround is to to wait a little time (maybe one second) to between user-group action operations (user join/leave group) and wait a short time before sending message to group. We are trying to fix this issue. Another workaround is to use connection-group operations as @Liangying Weimailto:lianwei@microsoft.com mentioned.

Thanks, Wanpeng Li


From: Bryce Barbara notifications@github.com Sent: Wednesday, November 25, 2020 2:57:57 AM To: Azure/azure-signalr azure-signalr@noreply.github.com Cc: Wanpeng Li Wanpeng.Li@microsoft.com; Mention mention@noreply.github.com Subject: Re: [Azure/azure-signalr] Clients not receiving group messages, yet they’re reported to be group members (#1125)

Repro repo: https://github.com/BryceBarbara/AzureSignalRUserGroupsIssuehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FBryceBarbara%2FAzureSignalRUserGroupsIssue&data=04|01|Wanpeng.Li%40microsoft.com|d4f78d1cac6c47d49dc908d890aadbdb|72f988bf86f141af91ab2d7cd011db47|1|0|637418410796494128|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=OH5Vk3dgy8zmg0PONX4tfsINk0bcTvz61ndIxyJBey0%3D&reserved=0

The readme in the repo should walk you through how to reproduce this issue. While testing this on my end, I was only able to reproduce it when using our Prod Azure SignalR service which is on the Standard pricing tier. Our dev SignalR service on the Free tier did not display this odd behavior.

To summarize what I had to do to cause the issue:

  • Switched NegotiationServer to using Persistent transport.
  • NegotiationServer removes user from all groups prior to assigning groups
  • Add an endpoint that manages groups after the client connects

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-signalr%2Fissues%2F1125%23issuecomment-733171278&data=04|01|Wanpeng.Li%40microsoft.com|d4f78d1cac6c47d49dc908d890aadbdb|72f988bf86f141af91ab2d7cd011db47|1|0|637418410796504087|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=89Pyx2VTjZREuOZ%2B%2F2bOWFfvtykCQ0uMr4XjDD%2BdukQ%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJDW7OLLEJ6JQAQRX44TF63SRP63LANCNFSM4UACEC4Q&data=04|01|Wanpeng.Li%40microsoft.com|d4f78d1cac6c47d49dc908d890aadbdb|72f988bf86f141af91ab2d7cd011db47|1|0|637418410796504087|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=Qu2G2oUZdi5nJnu3%2BwTlGD%2FcmrpG8duuAwGR3ub5XsU%3D&reserved=0.

0reactions
neuro-syscommented, Nov 16, 2022

Hi @wanlwanl,

Please update the SDK to the latest one, it uses ack message which will wait for the service confirm the message is handled.

Is the ack also added in .NET core version of SignalR?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not all recipients are receiving my group texts
I am having an issue with group texts. I have "iMessage" turned on, "Group Messaging" turned on in my settings, and I have...
Read more >
Why don't I receive group texts from family member...
On your phone, navigate to Settings>Application Manager>All>Messages, and choose Clear Cache & Clear Data. Clearing data will not erase your messages, it will ......
Read more >
Fix NDR error 550 5.7.1 in Exchange Online
If the recipient is an internal group: You might not have permission to send to the group or to one of its subgroups....
Read more >
How to properly configure Microsoft 365 Group email settings
Who do some users receive Group Outlook emails while others do not? I explain how to properly configure Microsoft 365 Group email settings....
Read more >
Understand Groups policies and limits
As a security measure, the Google Groups for Business service has limits for message activity, group size, invitations, and membership.
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