Skip to content

Null results not handled correctly in Java client #41775

Open
@BrennanConroy

Description

@BrennanConroy

We don't differentiate between a null result and no result in the Java client today. Looking at the .NET client we have a hasResult parameter when constructing the CompletionMessage

public CompletionMessage(string invocationId, string? error, object? result, bool hasResult)

vs. no hasResult in the Java client.
public CompletionMessage(Map<String, String> headers, String invocationId, Object result, String error) {

This causes code like below to never complete the client-side invoke:

class MyHub : Hub
{
    Task<string?> Get()
    {
        return Task.FromResult<string?>(null);
    }
}
connection.invoke(String.class, "Get").blockingGet();

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-signalrIncludes: SignalR clients and serversbugThis issue describes a behavior which is not expected - a bug.feature-client-javaRelated to the SignalR Java client

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions