-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No longer used resources not deleted #154
Comments
Yes this is a current limitation of the application - unused resources are not automatically deleted. It's on my to-do list though so it will be implemented at some point. |
Hi @laurent22 I have create a branch for this feature in my fork, can I create a PL? |
@marcosvega91, I had something quite specific in mind to get the resources cleaned up and to handle various corner cases. For example, let's say I have a note with this content: The solution I think is to keep track of the last time a resource was used in a note and if, after eg. 24h, it's still not in use, automatically delete it. I'm not keen to prompt the user every time a note is deleted either because of the UI complexity and since it's something that can be automated. Additionally, the resources should only be auto-deleted after a long period of time to handle certain edge cases. For example, when syncing, some resources might be downloaded before the note they are linked to and, if the sync operation is spread over several days (eg. for a new device being synced with thousands of notes), the resources might be deleted before the sync operation is over. For that reason, to be safe the resources are auto-deleted only after 10 days. What would also be useful is a screen that displays the list of resources and a way for the user to manually delete them. |
I have the same issue on macOS and iOS with Nextcloud. You can create and change entries and they will be updated on the different devices. But if you delete for example a note/folder on iOS, the corresponding files in nextcloud will be deleted, too. But on macOS the changes take no effect and the concerning files/folders/entries are still there. Would be fine if this issue could be fixed soon. =:-) |
@jcgerhard, that sounds like a different issue. You mean if you delete a note in macOS it doesn't get deleted on the other devices via sync? |
@laurent22: you are right...it seems to be another kind of issue. I try to describe it more exactly: |
@jcgerhard, if you enable debug mode is there any error in the log or console? Since deletion is the last thing that the sync process does, I expect there might be an error before that. |
@jcgerhard, you were right, items were no longer being deleted for certain sync targets (actually all of them except OneDrive). This will be fixed in the next version and the items will be deleted as expected (no manual action will be needed). |
Sorry for the late answer...I was busy the last days. |
...and if you then going to change the leftover note on iOS, you‘ll get an sync error. |
@jcgerhard, ah yes, that's because the iOS app hasn't been updated yet, that will be done in the coming days. What kind of error do you get when changing the leftover note on iOS? I guess there should be a conflict? |
yes...you get a conflict if you try to change the undeleted item. I will send you the log details tomorrow. |
Good morning @laurent22! Did the iOS update and a few create-and-delete tests this morning. Everything seems to work as expected now! Items and notebooks are going to be synced and deleted properly! TOP! Thank you for fixing it! |
Please re-open issue #220 (Hiding the app) ...it´s not working properly. In the issue I described what's the problem. Thaaaanks! |
The resource-deletion-issue still exists. No longer used resource/images won't be deleted on the synchronization target (in my case Nextcloud). I did a lot of "create/edit/delete" syncing test-runs over all iDevices (iPhone/iPad/MacOS) and everything works fine. All entries are modified, synced and deleted...BUT: in every case the images won't be deleted. |
Yes that's why the issue is still open :-) Some background worker needs to be implemented to find and delete resources that are not linked to any note. |
This should now be implemented as of v1.0.78. There's a service that runs every 4 hours and mark all resources that are not linked to any notes for deletion. They are then deleted 24 hours later. These are long delays to take into account various edge cases and to avoid accidentally deleting data. Please report here if you notice that some resources are still not being deleted. |
Closing it for now, but feel free to report any issue here. |
Thank you very much 🎉 |
Operating system
Application
If it is a bug if possible please provide a screenshot showing the problem
If there is an error, please copy and paste the full error message
When adding a file to a note, eg an image it will be referenced like this:
and the file is stored as
I use the folder
_sync_joplin
in my Dropbox as local storage for joplin data.Now, when you delete the reference from the note, the image disappears from the note (normal behaviour) but is still present in the
.resource
folder. Same behaviour if you entirely delete the note itself.Think about what happens after using the application for a very long time where you might have deleted a lot of notes, all the Files you added will still remain in the
.resource
folder and on operating systems, where file extensions matter you can't even double-click them to open from within the.resource
folder because they do not have a file extension and.A workarround could be to ask the user if a file is removed from a note or a note is deleted, if the file should also be deleted as a resource.
At least if a note is deleted, all files attached to it should be deleted, too.
Regards
PCFreak
The text was updated successfully, but these errors were encountered: