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.

No error thrown from AddAsync when ConnectionStringSetting is not provided for the C# function binding

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Y-Sindocommented, Feb 24, 2022

The ConnectionStringSetting itself has a default value AzureSignalRConnectionString, 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.

0reactions
alteredtastescommented, Feb 23, 2022

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”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - AddAsync() method is missing
When I type AddAsync manually I get the following error message: "Error CS1061 'DbSet' does not contain a definition for 'AddAsync' and no ......
Read more >
Azure Functions C# script (.csx) developer reference
Binding to arguments. Input or output data is bound to a C# script function parameter via the name property in the function.json configuration ......
Read more >
Jaliya's Blog: October 2021
With declarative binding, if the header x-application-user-id isn't set, Negotiate function will throw an error.
Read more >
Azure SQL output binding for Functions
The following example shows a C# function that adds a record to a database, using data provided in an HTTP POST request as...
Read more >
Build Function as a Service (FaaS) Solutions
Implement Triggers and Bindings for Azure Functions . ... if (!isAccepted) throw new Error('The query was not accepted by the server.'); } Provide...
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