Home / GitHub Page

Setting the delay before deletion of orphan resources


#1

Hi,
Is there a setting, to define the number of days/hours, before deletion of orphan resources (resources not tied to a note at all) ?
I ask that because, last week I added by with the webclipper ~ 100 articles, and now I don’t see the image inside them at all.
So to be sure it’s not a bug related to the cleaning tasks that drop “orphan resources”, I asked if I could set a lower delay of deletion.


#2

Most likely no, because it’s hard to set it to a “safe” value (one that wouldn’t lead to resources being accidentally deleted).

The reason is that when syncing, resources can arrive before the notes they are linked to, so if the sync process takes a very long time or is spread over several days due to poor internet connection, a resource that arrive eg. on day 1, will be deleted on day 3 because the note it’s linked to will only arrive on day 4. I got this issue recently when setting up a new device, and got several resources automatically deleted, so that’s why I’ve increased it to a very high interval.

Perhaps a solution would be to have a screen that lists all the resources with a way to view them and to decide if they should be deleted or not. This is very easy to create actually but haven’t had the opportunity yet - I’m going to add it as an issue on GitHub.


#3

Here is the issue: https://github.com/laurent22/joplin/issues/592


#4

In fact, just thinking about it made me realise the auto-deletion should have one more rule:

  • If a resource has never been linked to any note, it should not be automatically deleted. The reason being that it must be a resource that arrived via sync and its associated note has not been downloaded yet.

I think with this rule it should be safe to lower down the interval to 24h again.


#5

I understood.
thanks !


#6

something come to my mind about that.
the deletion of orphan resources should not be displayed under the sync button among the other counters to avoid to be afraid of disappearing resources “for nothing”, and could be displayed in the status window

for example yesterday I read “suppression distante:180” and I was asking myself why as I did not touch joplin for a while. I was scare to loose articles, then I remembered of that thread.