lichess-org / mobile

Lichess mobile app v2
GNU General Public License v3.0
1.29k stars 190 forks source link

Absence of signal is not detected as offline #294

Open S1M0N38 opened 1 year ago

S1M0N38 commented 1 year ago

If I put my Android phone in airplane mode, I'm able to use the offline features of the app. ok

However, if there is no connection at all, the app tries to connect to servers, and the app becomes unusable. notok

Is that intentional?

(Edit: maybe duplicate issue. PR #226)

veloce commented 1 year ago

We're using a simple approach to check connectivity which may be not enough, especially on android,.

References:

We need to improve detection and maybe not rely only on connectivity plugin changes only, but trigger another connectivity check upon request timeout.

S1M0N38 commented 1 year ago

I think that a simple 5-10 timeout that triggers offline mode could be a simple solution. Maybe later a more robust solution could be implemented as you suggested.

veloce commented 9 months ago

Do you still reproduce the issue @S1M0N38 ?

S1M0N38 commented 9 months ago

I've disable Wi-Fi and Mobile Data. I've enter the app and I can use all the offline features in the app.

However the original issue was about not connection at all (no cellular connection). Right now I don't know how to easily reproduce such situation. I think I have to go to some place without connection (e.g. mountain) or maybe in a Faraday cage (e.g. an elevator).

When I'm in a place able to reproduce this network status, I will update this issue.

S1M0N38 commented 9 months ago

puzzles.jpg

I was able to reproduce the issue on version 0.6.9

veloce commented 9 months ago

If you have a method with clear steps to reproduce, please share it. Thanks!

S1M0N38 commented 9 months ago

On a physical device:

  1. I've turn on Mobile Data (e.g. 4G or 5G)
  2. Reach for a place where there is no signal (I've been in the mountain)
  3. Open the Lichess app v2
  4. Navigate the app

I know that this is a minor issue but I think it's reasonable to think that when there is no signal the app should behave like the airplane mode is on. I restate that when the airplane mode is active offline features work as expected.

veloce commented 9 months ago

Ok, thank you. Indeed it should behave like airplane mode, after a timeout. We should now try to reproduce this signal loss programmatically to ensure a fix is working.