-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Null Result Issue with SignalRTrigger Functions in .NET8 Upgrade #2651
Comments
I am having same issue as well so looks like SignalR has not caught up with recent .NET8 upgrades |
I was just going to post something similar, Im also seeing this issue. |
I have did investigation on your source code and looks like you are passing the return object to the Sytem.Threading.Channels library in GrpcWorker:ProcessRequestCoreAsync() to send it over to the client side. I cannot go further but seems something there is ignoring our return object. It can be wrong assigment or anything, but it is outside of my reach. |
Can someone from admins add label potential-bug and need-attention? |
Hi, Has anyone seen any updates on this issue being investigated? This is also impacting my live project and preventing me from upgrading to .NET8, so I'm eager for this to be resolved asap. Thanks. |
@Y-Sindo Is this something you can help look into? |
Closing this as duplicate - please track using #1496 |
What version of .NET does your existing project use?
.NET 6
What version of .NET are you attempting to target?
.NET 8
Description
Hello,
I wanted to bring up an issue with the SignalRTrigger solution. My team and I are using this approach in .NET6 for our project to trigger some asynchronous operations. In response, we are returning a custom object indicating whether the operation was successful. However, in .NET8, our SignalRTrigger functions consistently return a null result in the server response, regardless of our efforts to fix it. It is worth mentioning that during the .NET8 upgrade, we are migrating our functions to isolated mode.
Expected
Function with SignalR trigger and return type will send custom response in result field to client.
Actual
Function with SignalR trigger is sending null result to client.
Examples
Click me
Here is our server-side code in .NET6:
The only change in .NET8 solution for this code snippet is the Echo function (in the SignalRTrigger attribute):
This is how we registered SignalR in .NET6:
This is our registration in .NET8:
And this is our C# SignalR client code:
We inspected the request and observed that the server side is returning null in the result property, regardless of what we attempt to send (e.g., a string instead of SignalRHubActionRequest or changing serializer to default or json one). We confirmed this by using tools like ngrok and Fiddler.
We tried several approaches, with the most promising one being the use of the SignalROutput attribute to bind the output:
[SignalROutput(HubName = nameof(MainHub), ConnectionStringSetting = "AzureSignalRConnectionString")]
This resulted in a server-side error. When we changed the return type to string while using this SignalROutput attribute, we encountered a different error.
Ultimately, we downloaded the latest codebase from your repository and used your samples, specifically the Extensions solution, and experienced the same null result issue.
This indicates that the problem lies within your library. We are unsure of the cause of these varying errors, but based on these examples, it appears you can return error objects. This implies you should be able to return an object in the result property as well. We initially thought this functionality was removed, but the errors suggest otherwise. Additionally, your documentation does not indicate that the feature to return objects from a SignalRTrigger function was removed. Therefore, we are requesting your assistance and investigation into this issue.
Thank you.
Project configuration and dependencies
Azure function app
Client app:
Link to a repository that reproduces the issue
https://github.com/Azure/azure-functions-dotnet-worker/tree/main/samples/Extensions/SignalR
The text was updated successfully, but these errors were encountered: