Open nlehuby opened 8 years ago
Could you try https://developer.mozilla.org/en/docs/Tools/Remote_Debugging/Debugging_Firefox_for_Android_with_WebIDE to debug the error? I'm semi-sure there is one.
BTW this is just what I've been using for debugging Firefox for Android, YMMV.
Nevermind, I can reproduce it as well. Weird, will take a look. Thanks for reporting!
It does work when you go offline after initially loading the app ; this bug only occurs when you first load the page offline. https://github.com/remotestorage/remotestorage.js/issues/869
I remember us chatting about it on IRC, so just to add it as persistent note here: rs.js currently thinks it's online when loaded (hence linked issue in previous comment), and only sets itself to offline when the first network request fails. If an app uses something like BaseClient#getAll
with a (default) maxAge
(for cache updates) as first, blocking method for showing data from remoteStorage, then that will fail, if the rejected promise isn't caught and the request is retried.
So this is both a problem of developer UX with this library as well as of this app (until the library handles this in a better way that lets the developer worry about it less).
@skddc So what exactly should be changed? I do use default maxAge
.
You can try to catch the rejected getAll
Promise and then set maxAge
to false
in a second getAll
request you'd do from there.
Alternatively, you could set remoteStorage.remote.online
to false
right away so it would get things from cache immediately. But then you'd have to listen for incoming change events and add items from those, because otherwise you'd not see new items until you getAll
again (or any items if the cache is empty for that matter).
@skddc is this changed in 0.14.0? I'm reviving this app again.
No, this is still the same behaviour afaik. So my first comment should still apply.
I think with apps for which you usually assume connectivity, it would still be best to catch the rejected promise and retry with maxAge
set to false
. This way you get the best performance and behaviour for all situations, except when offline during app startup, where it would take a little bit longer for first load.
When I try to use taskrs with no connection, I only get a "loading" message and the offline remoteStorage widget, but I cannot access my tasks anymore.