Skip to content

Commit

Permalink
Fix MQTT status message when disconnected while connecting (openhab#2951
Browse files Browse the repository at this point in the history
)

Signed-off-by: Jan N. Klug <github@klug.nrw>
  • Loading branch information
J-N-K authored May 20, 2022
1 parent fe5b1ed commit bf54474
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,9 @@ public void onDisconnected(@Nullable MqttClientDisconnectedContext context) {

public void onDisconnected(Throwable t) {
cancelTimeoutFuture.run();

final MqttConnectionState connectionState = connection.connectionState();
future.complete(false);
connection.connectionObservers.forEach(o -> o.connectionStateChanged(connectionState, t));

connection.connectionObservers.forEach(o -> o.connectionStateChanged(MqttConnectionState.DISCONNECTED, t));

// If we tried to connect via start(), use the reconnect strategy to try it again
if (connection.isConnecting) {
Expand Down

0 comments on commit bf54474

Please sign in to comment.