mobile icon indicating copy to clipboard operation
mobile copied to clipboard

Improve Error Message when Offline

Open nav-28 opened this issue 2 years ago • 7 comments

Currently the app shows error messages when the device does not have connectivity (see image below). We can improve this by showing a general message like on the home page or we could disable refresh to not reload the providers at all.

drawing

nav-28 avatar Jun 10 '23 17:06 nav-28

Hey @nav-28, I was thinking on taking this issue, however, I see a more generic message when I don't have connectivity on that screen ("Could not load live streamers"). Could you provide some more info please?

rool78 avatar Jun 25 '23 21:06 rool78

That specific error in my screenshot occurs when the data is already loaded and the devices loses connectivity. So after loading the data, disconnect the device and try refreshing the list it should give the error.

Generally, I think it should say something about the device's connectivity other than "Could not load live streamers". See the home page for an example.

Also if the data is already loaded you could disable refreshing if there is no connectivity.

nav-28 avatar Jun 25 '23 21:06 nav-28

Let me share with you how is behaving for me:

https://github.com/lichess-org/mobile/assets/54546499/e37191f7-d9f7-4c99-a8a1-3fde6e0e3213

Device: Android, Galaxy A13 API 33.

  • Notice I'm not getting the same error than you on the streamers list.
  • After recovering connection I cannot refresh so it's not possible to recover Streamer Widget.

rool78 avatar Jul 02 '23 19:07 rool78

I managed to get the same error on the streamers list harcoding an invalid url when showing StreamerListTile Image.network(streamer.image)

I think I'm ready to work on:

  • Improve error message, same as Home Screen.
  • Disable swipe to refresh when data is loaded and there is no connectivity.
  • Show a generic image when there is and error fetching it. What do you think about this one @nav-28 ?

rool78 avatar Jul 02 '23 20:07 rool78

Let's go with improving the error messages and disabling refresh when there is no connectivity.

I also have not been able to reproduce the image error, maybe something changes since I last created the issue. So, let's not put any generic image for now.

nav-28 avatar Jul 04 '23 02:07 nav-28

Couldn't find a naive approach to disable refresh on iOS (CupertinoSliverRefreshControl). We can allow to refresh on iOS but not reload streamers providers, what do you think?

rool78 avatar Jul 05 '23 21:07 rool78

What do you mean? I believe you can just set the callback to null

onRefresh: isNowOnline
                    ? () => ref.refresh(liveStreamersProvider.future)
                    : null,

nav-28 avatar Jul 05 '23 22:07 nav-28