Skip to content

Commit

Permalink
fix fabric8io#3957: Lister onOpen should be called before marking t…
Browse files Browse the repository at this point in the history
…he connection as open
  • Loading branch information
AdrianFarmadin committed Mar 14, 2022
1 parent 43bd021 commit ad6e893
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## CHANGELOG

### 5.12.2
* Fix #3957: Lister `onOpen` should be called before marking the connection as open

### 5.12.1 (2022-02-04)

#### Bugs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ default void onError(WebSocket webSocket, Throwable error) {}
}

public interface Builder extends BasicBuilder {


/**
* Builds a new WebSocket connection and waits asynchronously until the connection is opened.
* The listener onOpen callback is called before the returned future is completed.
*
* @param listener
* @return CompletableFuture which is completed after connection is opened
*/
CompletableFuture<WebSocket> buildAsync(Listener listener);

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public void onOpen(okhttp3.WebSocket webSocket, Response response) {
response.close();
}
OkHttpWebSocketImpl value = new OkHttpWebSocketImpl(webSocket);
future.complete(value);
listener.onOpen(value);
future.complete(value);
}

@Override
Expand Down

0 comments on commit ad6e893

Please sign in to comment.