No error thrown from AddAsync when ConnectionStringSetting is not provided for the C# function binding
See original GitHub issueDescribe the bug
For a while, I was blocked trying to understand why SignalR service was not sending messages to my group, when negotiate and adding to the group were appearing to work fine.
Using examples from the docs (here), I found that the ConnectionStringSetting = <Signal R Connection String>
parameter is not provided for the C# examples. This took a while to figure out, and I have submitted a separate docs issue on that page (here).
While I was debugging the issue, I had attempted to use try/catch to wrap await signalRMessages.AddAsync(...)
and figure out where things were going wrong, but no exception was ever thrown. The AddAsync method is missing some essential error handling and, in my humble opinion, its absence should constitute a bug. Nothing indicated that no connection string was provided for the SignalR binding, I was just lucky that I found an example elsewhere that had it included.
To Reproduce
Use the Send To a Group example from the docs and see that it will fail to send any messages. Wrap the signalRMessages.AddAsync(…) method call in a try/catch and see that no error is thrown.
We will close this issue if:
- the repro project you share with us is complex. We can’t investigate custom projects, so don’t point us to such, please.
- if we will not be able to repro the behavior you’re reporting –>
Exceptions (if any)
Further technical details
- Azure Signal R serverless mode
- Microsoft.AspNetCore.SignalR 1.1.0
- “@microsoft/signalr”: “^5.0.10”,
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
The
ConnectionStringSetting
itself has a default valueAzureSignalRConnectionString
, and all SignalR output bindings with the same connection string setting share a same SignalR hub context, so there should be no differences. I’ll close this issue as it is unreproducible. Feel free to reopen it if you have new evidence.I will say however… I find passing ConnectionStringSetting to be preferable. It is harder to know how the connection string is being referenced for SignalR when it is done implicitly via the default check and naming convention of “AzureSignalRConnectionString”.