Haptic-Apps / Slide

Slide is an open-source, ad-free Reddit browser for Android.
https://reddit.com/r/slideforreddit
GNU General Public License v3.0
1.78k stars 344 forks source link

Offline browsing unavailable gifs/albums #2179

Open andree182 opened 8 years ago

andree182 commented 8 years ago

Slide version: 5.4.3.7 Android version: 6.0.1

When browsing offline, and some of the content is not cached, e.g.

slide apparently tries to access the content online. If there is no signal (or very weak), this seems to "freeze" the app - the progress bar "flows", and even if some different image is attempted, it will not open until the previous operation times out, or app is closed+opened.

If I disable the data connection entirely, a normal error message about conversion error is shown and all works as expected.

Apart from usability problem, maybe this has a potential to waste users bandwidth, loading the gifs that should've been loaded offline...

ccrama commented 8 years ago

Slide doesn't cache albums at all, and it will cache gifs when possible. The gif issue should be fixed when Gfycat fixes their API, it doesn't actually try to load while offline but shows the loading bar if network connection is possible

andree182 commented 8 years ago

Okay, but enabling offline mode should result in never touching network, no matter if gfycat works or if you currently cache albums or youtube videos or whatever... if you just show message box "unavailable offline, proceed?", it's much better than trying to download possibly multi-megabyte data, IMO.

ccrama commented 8 years ago

It doesn't try to download, it will fail every time. It will show that dialog if it knows the content doesn't exist, and tries to get it to load from the cache if it does. It's pretty difficult to figure out if it does or doesn't exist, which is why we allow you to open it and try to load it

On Sep 20, 2016 1:19 AM, "andree182" notifications@github.com wrote:

Okay, but enabling offline mode should result in never touching network, no matter if gfycat works or if you currently cache albums or youtube videos or whatever... if you just show message box "unavailable offline, proceed?", it's much better than trying to download possibly multi-megabyte data, IMO.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ccrama/Slide/issues/2179#issuecomment-248212300, or mute the thread https://github.com/notifications/unsubscribe-auth/ADpJRFTTdnjWNnan_e0N2muk-IKCXxuFks5qr3rVgaJpZM4KA86G .

andree182 commented 8 years ago

But anyhow, from a users perspective, it looks like it's trying to load something. It looks like it behaves like this:

if (network)
  checkOnlineStuff();

if (!contentIsCached)
  showError();
else
  showContent();

Is it not possible to instead use if (!offlineMode && network) somehow? I didn't check your caching code/architecture, so perhaps it's not possible doing it without significant refactoring - in such case feel free to close the ticket.

But as written in the first post, if you happen to be e.g. in subway, where one appears to have data connection, but barely working, the offline mode is barely useful too. It starts being useful after I disable the mobile data... But then it's a question, whether "offline mode" is the right name of the mode, perhaps "cached mode" could fit better?