dotnet / dotnet/aspnetcore

Null results not handled correctly in Java client

Open
#41,775 1 comment 1 reaction 0 assignees View on GitHub
area-signalr bug feature-client-java
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

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
https://github.com/dotnet/aspnetcore/blob/e9a9108db352b714a64a01ff3be5c5c59e08ca7c/src/SignalR/common/SignalR.Common/src/Protocol/CompletionMessage.cs#L36
vs. no `hasResult` in the Java client.
https://github.com/dotnet/aspnetcore/blob/e9a9108db352b714a64a01ff3be5c5c59e08ca7c/src/SignalR/clients/java/signalr/core/src/main/java/com/microsoft/signalr/CompletionMessage.java#L15

This causes code like below to never complete the client-side invoke:
```csharp
class MyHub : Hub
{
Task Get()
{
return Task.FromResult(null);
}
}
```
```java
connection.invoke(String.class, "Get").blockingGet();
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.