cozy / cozy-flagship-app

GNU Affero General Public License v3.0
9 stars 1 forks source link

feat: Allow cozy-apps to access files offline #1237

Open Ldoppea opened 1 month ago

Ldoppea commented 1 month ago

When the application is offline, we want the user to be able to access their files that are accessible offline

To make this possible, we want the Flagship app to provide a new downloadFileAndPreview() interface that can be called from cozy-apps

Internally this method should allow to download and preview files, but also to store them in the device's storage in order to make them accessible later even when the app is offline

This method will be called from cozy-client through file model

For now we make files accessible only if they have already downloaded once


We also want the user's important files to always be accessible offline

To make this possible, we want the app to download them in background on startup

We consider important files as files from mespapiers with specific qualification labels like passport, identification papers, vehicle registration, etc.


Finally, as we store offline accessible files in the device's storage, we want to prevent them to fill the entire device's storage

We chose to keep only files that were accessed in the previous month. All other files would be deleted

Important files are never deleted as long as they exist on the Cozy instance


TODO: