The “Delete unlinked resources” plugin will delete all attachments in Joplin 3

It's possible that older attachments are still safe:

Explanation based on the plugin's code.

The plugin seems to use the following logic to determine if a resource is unlinked:

0 == (await joplin.data.get(['resources', resource.id, 'notes'])).items.length

This requests the list of notes associated with resource.id from Joplin. Joplin responds to this request using information that isn't updated very often (I think 30 seconds after Joplin's startup, then every few hours). As such, the plugin thinks that a resource that was just attached to a note is linked to by no notes.

Based on this, older attachments might still be safe.

Edited: Reformatted and reworded.

2 Likes