I am kind of curious when exactly ‘is_associated’ in ’
note_resources in the database changes from ‘1’ to ‘0’ / the resource is marked as unassociated. For example:
I create a note with an image: then image appears in resource_dir
I delete the image in the note: image stays in resource_dir and is_associated = 1 in database
After some time (?) / closing joplin (?) / syncing (?) it changes to ‘0’ (while the image stays in the resource_dir).
Never found out exactly when it gets unassociated. Does anybody know ?
I read all 29 replies twice and did not find an answer when exatly is_associated changes from 1 to 0…
laurents reply: “If a resource is associated with any note, is_associated is 1, it it’s not is_associated is 0. From the moment is_associated is 0, a timer starts and after x days the resource is deleted.”
also doesn’t really help…
I prefer to give the usual warning - those are internal stuff in Joplin and it’s better not to build scripts around it because the behaviour might not be exactly as you think, and it might change from one version to the next.
Especially for things like deleting items I personally wouldn’t rely on this. There’s no unit tests to verify what you’re doing so you can’t be sure about much.
agreed, fiddling around with internal stuff isn’t a good idea … although if you’re using the joplin api for deleting resource ids it feels rather safe … of course this is just a workaround until joplin will do it itsself (no pun intended, I think joplin is AWESOME !). And thank you laurent for being around replying