-
Notifications
You must be signed in to change notification settings - Fork 302
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
Delete notebook in Orgzly when file has been deleted in repository #287
Comments
I'm also finding this annoying in Orgzly with syncthing. It might be good to have an alert when this happens: "notebook was deleted from repository. Delete from Orgzly too?" Yes/no, and "remember my decision" Plus something in the settings to reset the "remember my decision" thing. I'm perfectly happy for it to always delete, but it might cause data loss in some cases. Another option that would help with the syncthing case (and possibly also other cases) would be to have an ignore pattern for org filetypes, e.g. ignore |
I have an idea for an easy fix. Check if the notebook was ever synced to or from the cloud. If it's present locally, but not on the cloud, ask whether to reupload the local version to the cloud or to remove it. |
Got 4-5 devices that sync files edited by Orgzly (and some text editors) It's nearly impossible to delete a org-file - like ever Whenever I'd want to do that, I'll have to delete the file on each device BEFORE one of the other devices synced it's changes back onto my server and re-creates the file. Alternative Implementation: when a notebook is synced and the file doesn't exist, at least ASK if the file should be re-created. |
I'm looking into some changes for repos and syncing (for new repo types) and will be having this in mind. |
Any progress on this issue? If not, I might try implementing a solution. My best suggestion is to ask the user whether to delete the file on device, or sync it, as suggested by @DrAzraelTod and @appetrosyan. |
Not that I know of.
The problem with asking is that sync is done in the background and can also be started automatically. So user might not be in the app. But perhaps it could be just marked as deleted and not synced after that. It could be flagged in notebooks list and user could delete it manually later. Though I wonder if this is even worth it (it does feel kinda hackish) and how risky is to simply delete the notebook. |
My thought was to treat deleted files in the same way as files that have been changed both in the app and in the cloud, i.e. with a Force Load/Save option. With this approach, you would get the option to Force Load/Save whenever a file is deleted in the cloud, or a new notebook is created in the app. These two cases may be slightly tricky to distinguish from each other(?), so they could be treated equally. This does not feel hackish to me, the only disadvantage is the need to explicitly confirm that a new notebook created in the app should be synced to the cloud. This could eventually be fixed by a flag that indicates whether the notebook ever existed in the cloud. (Or possibly by using already existing variables?) |
Yes, |
Although inconvenient, some may find this workaround helpful.
|
Does this problem happen when syncing via dropbox? |
This could be easily avoided if orgzly had an exclude file feature so that Ignoring on syncthing is bad because you could lose data. It's good to sync your conflict files, the problem is we need orgzly to ignore them I think. |
@codygman It seems to me the problem doesn't have anything to do with syncthing. If you used another program to sync your directory containing org files, the problem would still be there. |
@philip-bl I didn't say the problem has anything to do with syncthing. It's because orgzly has a database as the source of truth rather than the filesystem synced by syncthing or any other file syncing tool. You could get around the problem by making sure |
@codygman I don't see what
|
@philip-bl Ah, okay. I've only used orgzly with syncthing so I didn't know that. I almost never delete my org files either, so just a way to ignore any conflicts so orgzly doesn't keep them alive would have sufficed for avoiding "zombie" files. |
I understand the difficulty of implementing this feature in a way that does not make it easy to accidentally delete notebooks. I certainly prefer a cautious approach. And deleting a notebook is something I do rarely, so it's not a tremendous hassle to clear the database and re-sync after deleting a notebook on my PC. Until this feature is implemented, this limitation and workaround should be documented in the manual. I spent several minutes repeatedly, carefully looking through the options and menus to try to find a "Delete notebook" button, and then searched the "Getting Started" notebook. I finally had to come here, to the GitHub repo, to find information about deleting notebooks. |
One problem with clearing the database and then re-syncing is that all your custom searches would be lost as well, which is really inconvenient. Before a proper fix is implemented, I think at least the app could offer an option to preserve the custom searches when clearing the local DB, which should only delete the files, but not the searches. |
Any update on this issue? Last comment on this thread was almost a year ago! |
Yeah, it kept me from actually using saved searches since I'd have to just delete them anyway or fix a lot of "conflicts". Which is sad, because that's one of the most valuable things in orgzly when I think about it. |
In my case I had to remove the repository and clear the database (settings > app > clear database > ok), and re-add repo because of this. |
More than a year since my last comment! This is the only thing stopping me from using orgzly. |
My rather tedious workflow for these conflicts is:
Agreed that this can create some nasty surprises, but you should know that you can manually export1 your searches to a local file and then re-import them after a database purge. Footnotes
|
While it doesn't exactly solve it, as a workaround, I empty the file and set the org title to |
gash, now I know why all the sync-conflicts keep reappearing... |
I started using Syncthing. I have renewed interest in seeing this bug get fixed. |
Can this please please please be fixed? I have a workflow in which I regularly delete notes which is impossible to maintain with this. Every time I delete a bunch of notes they just come back. |
I've moved to logseq and advise others to do so |
The primary reason I use orgzly is because I need the integration with tasks. Does that work on logseq? Also: are there any synchronization options available there? If it requires external synchronization it's very hard to make it work well with nextcloud. |
I created a bit of a workaround that is acceptable to me for the time being. I am posting it here in case someone might find it useful. I have created a custom function which goes through all of my journal files one by one and gives me the option to either keep [k] or delete [d] the file. In case I choose delete, a task gets added to the bottom of the file with the 'delete'-tag in order for Orgzly to be able to find the files with a filter. (defun org-roam-dailies-clean ()
"Keep or tag note files for deletion."
(interactive)
(let ((daily-directory (expand-file-name "NameOfJournalDirectory" "/path/to/this/directory/"))
current-file)
(dolist (file (directory-files daily-directory t "\\.org$"))
(setq current-file file)
(find-file current-file)
(let ((keep-or-delete (read-char-choice "Want to [k]eep or mark for [d]eletion? " '(?k ?d))))
(cond ((eq keep-or-delete ?k)
(message "Keeping %s" current-file))
((eq keep-or-delete ?d)
(goto-char (point-max))
(insert (format "\n* TODO %s :delete:" (file-name-nondirectory current-file)))
(save-buffer)
(message "Marked %s for deletion" current-file))
(t (message "Invalid option"))))
(kill-buffer (get-file-buffer current-file)))))
(map! :leader
:prefix "n"
:desc "Keep or mark note files for deletion" "rk" #'org-roam-dailies-clean) This method could be billion times easier if it would be possible to:
|
Every time i delete an org file, it is recreated when opening Orgzly. Instead, I would like to be able to delete a file on another device and have it removed from Orgzly as well.
This is especially important when using Syncthing underneath the file sync, as it can create sync-conflict files which are better resolved (and then deleted) with a proper text editor. Now I have to delete it from Orgzly, and it would make it impossible to use two syncing Orgzly instances.
The text was updated successfully, but these errors were encountered: