Fix MQTT status message when disconnected while connecting (#2951)

Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
J-N-K 2022-05-20 20:45:01 +02:00 committed by GitHub
parent fe5b1ed6ac
commit bf54474b03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -162,10 +162,9 @@ public class MqttBrokerConnection {
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) {