orgzly / orgzly-android

Outliner for taking notes and managing to-do lists
https://www.orgzly.com
GNU General Public License v3.0
2.7k stars 304 forks source link

Check content equality to prevent sync errors #1023

Open xeruf opened 1 year ago

xeruf commented 1 year ago

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

I moved my org file folder, and now it is quite annoying having to check on and move all the notebooks, as it says:

For both of these, content equality could be checked and the link automatically recovered.

BrianA-MN commented 10 months ago

Usually, both these errors can be cleared simply by removing and remaking the link. In orgzly, touch and hold the notebook with the error message until it is highlighted. Then in the upper right touch the three dots, and touch Set Link, in next window select remove link and then set. Then again on the same notebook page touch until highlights this time, touch the download button, select the SD card repository file, which will set the link to the file you wish to sync. This has always solved the problem for me. Be aware if you've made changes to the Notebook on the android, you'll be getting the last sync'd version so some updates may need to be redone in the notebook file. Now when you use the Snyc function of orgzly it with properly sync the file.

Realize that orgzly keeps a copy of the notebook in its working directory and doesn't communicate with the android's SD database until a sync is initiated. So when you make changes in the notebook you are working on a different copy than the SD database version. Personally, to work on both the android and my Slackware Linux Emacs org-mode files I use mobile-git-sync along with android FTP_Server. That means I always first use orgzly "sync", then start the FTP server, then from Slackware terminal issue a mobile-git-sync. For those familiar with git it works fine, although there are perhaps more steps, than simply using syncthing I also have version control for any conflicts which need to be merged.
Hope this helps. Cheers.

xeruf commented 10 months ago

I know I can relink it, but if you have dozens of notebooks, this is very cumbersome. That is why I propose that it could automatically relink on content equality.

BrianA-MN commented 10 months ago

OK I'm not familiar with the term equality, but taking it at its face meaning, wouldn't that require the files be exactly the same in size, date modified, and any other security signatures of the repository? Which would not be the case if the file in the repository had to be recovered with a git-sync or ftp from an external source. I also believe equality might not work with all forms of syncing. It seems that the developers are thinking of separate code steps depending on the repository type, ex. Dropbox, WebDAV, directory, x-Cloud service.

I also hope my answer will help others who occasionally see these errors and don't know how to recover from them. I think I spent over two hours scouring the Documentation without an answer and finally figured it out by chance. Cheers