syphon-org / syphon

⚗️ a privacy centric matrix client
https://syphon.org
GNU Affero General Public License v3.0
1.04k stars 71 forks source link

Offline exponential backoff iterates too quickly #665

Open EdGeraghty opened 2 years ago

EdGeraghty commented 2 years ago

Perhaps in addition to reducing the backoff, we should have a way for the user to force the client to attempt reconnection; being offline for a few minutes with the client running makes it inoperable without restarting it

ereio commented 2 years ago

Maybe if you've been offline for 10 seconds or so a snack will appear asking if you want to attempt to reconnect?

Note there's already a listener for if your internet connectivity has changed, it will ignore the backoff and attempt to sync again.

EdGeraghty commented 2 years ago

I found this by closing the lid of my MacBook for 3~5 minutes, then opening it up again, and just having that lightning symbol against my avatar until I force close & restart Syphon

EdGeraghty commented 2 years ago

In playing with #668 I note that the background sync doesn't actually appear to back off, unless I'm missing something. I can see it firing the catch but if one sets the proxy to offline it just spams instead of ever backing off in the background sync loop...

ETA: I see why this is happening - https://github.com/syphon-org/syphon/blob/bed028f3282f36ab64edba0fbdf110ebbacdbc5d/lib/store/sync/actions.dart#L110 ConnectionService.isConnected() returns true because it's passed off the the underlying OS, which has connection.