Connection attempt when offline

In the past, if I was offline not connected to any network, DC would simply say “Not connected”. Now with the new version of the app, if I am offline not connected to any network, DC will say “Connecting…” and seems to try connecting despite no network connection. Its like it can’t tell when there is no network connection. Is there some reason for this change or is this some bug?

this might be a bug - or the state is really flaky.

in general, there is still the clear state “Not Connected”.

if you can reproduce the issue, you might want to give additional infomrmation and attach a log

The only way DC knows if it is connected is if connection succeeds. When you move the app to the foreground, most UIs (you did not specify which app you are using) call maybe_network() so DC will try to connect, changing the state to “Connecting” and attempting a connection. If it fails, then it switches back to not connected. It is correct, the app is trying to connect if there is no network. We have not changed the code around connectivity state recently, so you probably upgraded from a quite old version.

What can be done about the flickering is some sort of delaying the update: when the connectivity state changes, schedule its update to ~100 ms in the future. If another update happens, shift the UI update again. Only if there are no changes for 100 ms, actually display the new state.

Thanks @r10s and @link2xt for this information. I wasn’t sure what the expected behavior for this is. The past behavior seemed more “intelligent” to me because the “Not connected” state changed immediately to “Connecting…” as soon as you connected to a network then immediately changed back to “Not connected” as soon as you disconnected, and it would never display “Connecting…” if you weren’t connected to a network, so it seemed to me DC always knew when I was connected to a network or not. But I guess it never really knew when I was connected to a network or not but the old behavior of the app suggested it knew this?

I don’t experience a problem with flickering, I was just asking about this because I didn’t know if the new behavior was intended or a bug.