Commit c6132148 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Unregister all observers if all reconnection attempts failed

parent e2c0e9b4
...@@ -315,10 +315,11 @@ public class RocketChatWebSocketThread extends HandlerThread { ...@@ -315,10 +315,11 @@ public class RocketChatWebSocketThread extends HandlerThread {
} }
reconnectSubscription.clear(); reconnectSubscription.clear();
}, },
err -> { error -> {
logErrorAndUnsubscribe(reconnectSubscription, err); logErrorAndUnsubscribe(reconnectSubscription, error);
connectivityManager.notifyConnectionLost(hostname, connectivityManager.notifyConnectionLost(hostname,
ConnectivityManagerInternal.REASON_NETWORK_ERROR); ConnectivityManagerInternal.REASON_NETWORK_ERROR);
new Handler(getLooper()).post(this::unregisterListeners);
} }
) )
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment