Deleted local resources not synced again

As this is my first post let me start saying that I really like Joplin. Many thanks to all people working on it! And also a short hello to the people in Joplin discourse.

My Setup:

  • V 1.54 (tested other Versions too) on Windows 10
  • Sync via WebDav to local NAS
  • Sync Resources manual

Steps to reproduce:

  • attach file (PDF in my case) to a note
  • sync, afterwards doub le check the file is synced and exists on sync target
  • delete file from local resources folder
  • click on the files link in the note
    => Expexted result: File is downloaded again just like other missing files
    => Current result:
    Error: ENOENT: no such file or directory, lstat (followed by path)

As I am into it now I would also like to suggest an option to delete all local resources. That would perfectly fit the manual download setting. That of cause only makes sense when the described bug is fixed.

@netfrettchen welcome to the forum.

If I have understood your post correctly I believe that your "expected result" is based on a wrong assumption.

Anything in the Resources folder should not be edited, moved or deleted by the user. The Resources folder is there for Joplin and should be controlled only by Joplin. If you manually delete resources Joplin's local database will still have that file recorded as being present, so it has no need to download it again, hence the error. That is also why when you edit a resource you must do it through Joplin so that it can monitor the change. If you manually edited a resource outside Joplin, Joplin would again not know of the change and so would not know to upload the updated version to the sync server.

It is not "Manually Downloading" but "Manually Syncing" and syncing means copying changes to what is stored locally on your machine to the server, and what has changed on the server to your local machine.

Thanks for your answer.
So it was not the fault of the Software but my fault to delete those file. I understand that it is not meant to manipulate notes and assets out of the App.

But anyway: I think it cannot be hard to implement such logic: If a file that should be found local is not existing try getting it from remote (at least if DL mode is set to manual). That would make sense, doesnt it?

And based on the logic that one should not touch resources folder we strongly need an option to delete those contents from within the app - again only when DL mode is set to manual.

I see what you mean now. In that if the Attachment download behaviour setting is set to "Manual", once attachments have been selected and downloaded they remain on the system. I believe that you are suggesting there should be an ability to flush those manually downloaded attachments and update the Joplin database to say they are no longer on the device and would need downloading again?

I am not a dev so I do not know if this is easy to do or even possible. However it does seem logical that if someone has needed to set the attachment download behaviour to manual to save space, they may wish to reclaim that space if, over time, they have selected many attachments for download.

Thats it, exactly. Do I have to make a new topic for this feature request or will it be recognized by the devs as it is now?

It may be seen but I am sure it cannot hurt to post this suggestion in the feature request area of the forum ("Features"). Just briefly explain the situation you have identified along with the potential benefits of your suggestion and see what happens.

I only mention doing it this way so that when @laurent goes flying through the forum posts he may see yours and think, "Oh, that makes sense". He is then more likely to to add it to his list of things he would like to do :slight_smile:

This topic is continued as Feature request in this topic:

This topic can be closed / deleted.