I would like to install Joplin on my iPad which has a low storage space. I will choose to download resources in “Auto” mode (only when opening a note) to prevent downloading everything on the device.
The problem is that after many notes openings i will have a huge amount of resources available and I would like to be able to see how much storage it is using and have the ability to delete them all to reset this “cache” space.
exactly, i have discovered that my iPhone had more than 50GB data for Joplin while I only have half data .. I presume all crypted were there and i cannot delete them myself
I think for safety, the function should only be allowed when attachment behaviour is set to manual or auto. If it is set to always, then deleting all resources will result in a full resync of all the resources on the next sync
add a “Delete cached resources when opening/closing Joplin” setting which would enabled when user selects Auto or Manual in the download resources choice
When the user has chosen to Always download all resources he won’t be able to use that
When the user has chosen to manuel or auto download resources, he will be able to check this setting and when Joplin opens or closes it will automatically delete all resources
That may be a good way of keeping resources clean .. I don’t know what is better : at opening or closing .. on mobile closing an app may be harder to detect, maybe it’s better to do it before starting any background service when app opens.
Other option would be to have a button to delete all cached resources but it’s a one shot action and people may forget to do it regularly and get many unused resources on the device (and there is the issue to delete resources while Joplin is working)
I don’t think that would work to be honest, as there isn’t any way to close the mobile app other than to kill it, which will prevent any task from running. Not to mention that there are already limitations with the mobile app that it cannot do anything in the background, most notably to sync in the background (which is a long time requested feature, but also with no completely reliable solution).
Cleaning on opening the app would probably not be good either as the are already a number of maintanence tasks which run on startup and it’s best not to add another unnecessarily.
A manual delete local resources option should be supposedly more straightforward though
So that adds complications to having a scheduled task to clear down the resources folder. However if adding a manual action on mobile, in addition to validating attachment behaviour is set to manual or auto to allow you to do the deletion, it could validate that there are no outgoing changes pending to be synced (as the crypted files are only created before uploading an outgoing resource change to be synced, or when downloading a resource, which only happens on demand if attachment behaviour is set to manual or auto). Under those circumstances, it’s only possible that any new changes to files in the resource folder since starting the deletion task could be in use by the encryption service, but a timestamp could be recorded in memory when the task was started, and for each file, check the timestamp is before the start time, and only delete the file if it is
I think you are right, let’s just keep only a button to do that instead of trying to do schedule it.
But there are two cases :
When the user use “Download resources : Manual or auto” he may need to have a button to “Delete all cached resources” to be able to “reset” the storage space by removing all resources already downloaded to avoid using too much space. In my case, i had downloaded all resources and i had to completely remove and reinstall Joplin to set back to “Auto” and only use 1GB.
But i think there is also a need to be able to delete all .crypted files that are not useful anymore and take a big amount of storage space.
For example with my total 30GB storage Joplin, when i had chosen to download everything on my iPhone i had more than 50GB used on it. Deleting the .crypted files would have at least saved 20GB so i feel that’s quite important as they will never be used by the user. For that part i would have loved to have a system task to delete them as they are not useful anymore but if a button can do it, that’s better than nothing.