dotnet / dotnet/aspnetcore

SignalR Java client: disposing Completable returned by HubConnection.start() does nothing

Open
#36,298 4 comments 0 reactions 0 assignees View on GitHub
area-signalr feature-client-java
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Describe the bug
It is not possible to prevent `HubConnection` from starting with dispose call on `Completable` returned by `HubConnection.start()`.
[By looking at the code there is no `doOnDispose` or alike](https://github.com/dotnet/aspnetcore/blob/a9986c33a51f5ceda5854cbfc8969f4c9079caf7/src/SignalR/clients/java/signalr/core/src/main/java/com/microsoft/signalr/HubConnection.java#L225)

If one is unaware of this, it could lead to unwanted connections.

### To Reproduce
```java
HubConnection hubConnection= HubConnectionBuilder.create(...)...;
hubConnection
.start()
.subscribe(connection->/*do something*/)
.dispose(); // this does nothing, connection is created
```

### Further technical details
- Client version: 6.0.0-preview.7.21378.6

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.