Skip to content
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

Orgzly seems to recreate files deleted from the org-mode directory #77

Closed
LeafyLappa opened this issue Nov 14, 2023 · 2 comments · Fixed by #248
Closed

Orgzly seems to recreate files deleted from the org-mode directory #77

LeafyLappa opened this issue Nov 14, 2023 · 2 comments · Fixed by #248
Assignees
Labels
bug Something isn't working org-roam Affects support for org-roam usage

Comments

@LeafyLappa
Copy link

LeafyLappa commented Nov 14, 2023

  • I have searched for existing issues that may be the same as or related to mine.

I want to start using orgmode as a personal GTD system. I came across this post on reddit:

https://www.reddit.com/r/orgmode/comments/14czljd/orgzly_orgmode_android_client_has_a_fatal_bug_for/

orgzly/orgzly-android#287

This bug seems critical. I found related issues on this repo: #22 and #28 however they while seemingly related to the mechanism they don't seem to mention exactly the same problem.

Has this been fixed anyhow?

@LeafyLappa LeafyLappa added the bug Something isn't working label Nov 14, 2023
@amberin
Copy link
Member

amberin commented Dec 2, 2023

We should definitely be able to solve this with a prompt to delete the notebook from Orgzly, as suggested in orgzly/orgzly-android#287.

I suppose the first step is to add this as a sync status, something like BOOK_WITH_LINK_AND_ROOK_DOES_NOT_EXIST. And then prompt the user from com.orgzly.android.sync.SyncUtils#syncNamesake, and delete or keep the local notebook accordingly.

@amberin amberin added the org-roam Affects support for org-roam usage label Apr 29, 2024
@amberin
Copy link
Member

amberin commented May 5, 2024

I am working on this.

@amberin amberin self-assigned this May 5, 2024
@amberin amberin linked a pull request May 18, 2024 that will close this issue
amberin added a commit to amberin/orgzly-android-revived that referenced this issue May 19, 2024
This resolves orgzly-revived#77.

We are adding two new BookSyncStatuses:

- ROOK_NO_LONGER_EXISTS
- BOOK_WITHOUT_LINK_AND_PREVIOUS_ERROR

The first one is pretty obvious, but the second one requires some explanation.

When a remote file is deleted, I have chosen to do two things to
Orgzly's namesake notebook:

1. remove the book's repository link
2. clear the book's "synced to" attribute (which typically holds the
   last seen revision ID of the repository file)

I chose to do this because it then becomes much easier to draw conclusions
about the book's state during subsequent syncing attempts.

One of the things it allows us to do is to NOT automatically link the
notebook to the configured repository and sync it. This was the annoying
previous behavior which we want to get rid of. For background, when
Orgzly sees a local notebook without a repository link, and there is
only one configured repository, it will usually silently link the
notebook to the repository and sync it. This is great when the user has
created a new notebook in Orgzly, but it's not desirable when something
more unusual has happened, such as a file deletion. Instead, we want the
user to be alerted about the deleted file, and then take action
themselves. They probably want to delete the notebook from Orgzly, but
they may also want to link it to a different repo, or back to the same
one, in case the deletion was a mistake.

In other words, the new sync status BOOK_WITHOUT_LINK_AND_PREVIOUS_ERROR
allows us to distinguish between a local book which can be automatically
linked to a repo and synced, and one which should not be touched, but
left in an error state until the user takes action.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working org-roam Affects support for org-roam usage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants