DanielDe / org-web

org-mode on the web, built with React, optimized for mobile, synced with Dropbox and Google Drive
https://org-web.org
The Unlicense
1.39k stars 83 forks source link

FR: Full offline support #89

Open farynaio opened 4 years ago

farynaio commented 4 years ago

Is your feature request related to a problem? Please describe. This feature is meant to solve at least two problems:

Mobile apps are killed easily by OS, so we can't keep them forever alive to have offline access to org files.
If we use Chrome, we can have only a single instance of org-web showing a single org file. Switching between files will cause re-download and BSOD (black screen of death - which is white BTW) "internet not available".

These two issues make org-web quite useless and unreliable in offline mode.

Describe the solution you'd like The solution would be to use local storage to store every visited org file, so even if we would be in offline mode we could have all features available - other than sync of course.

At any time when the network will be available again, we would sync current state with remote one, as simple as that.

This solution will not cause any additional problems because the sync mechanism is already implemented, so we can piggyback on it.

Describe alternatives you've considered

Using offline pages in Opera on mobile - it doesn't work with web apps, it caches only CSS and HTML so it works only for plain static pages.
Opt-out org-web from Android battery optimization - the app stays alive but we can access only a single file at a time. If we switch files or kill it by an incident we will get BSOD.
Tried Firefox, Chrome, Opera on Android - all of them refresh the content of the page when we reopen the app after killing.

Additional context none

DanielDe commented 4 years ago

This is an interesting idea I hadn't considered before. My idea of doing "offline support" has always been to use web workers, which would effectively let org-web run the latest version of itself since it last had internet. That way org-web can start up again even if the page gets unloaded.

But this is a much simpler approach that still provides some value, I like it!