Replies: 7 comments 4 replies
-
Sounds great - I hope someone can try this out. It might require some tweaks to ContentRepo to parse book names correctly, but that shouldn't be hard once we see the resulting URIs. |
Beta Was this translation helpful? Give feedback.
-
I will try this out myself, since #312 apparently broke this. I suspect there are a few different ways to make it work, although none of them are pretty. I have a feeling that there is no pretty way of achieving this, because we are clearly working against Android's design here. I'm thinking of this disclaimer in the DocumentFile docs (emphasis is mine):
|
Beta Was this translation helpful? Give feedback.
-
I've found a way to build a "repo relative path" from any content:// file URI. It works, but it's expensive and convoluted. Remains to be seen how slow it will be. |
Beta Was this translation helpful? Give feedback.
-
I've noticed a problem with this kind of setup, unrelated to subfolders (it exists in 1.8.26). When syncing local changes, everything looks good, but upon the next sync, the book is loaded from the repository, instead of showing the "no changes" status. It is caused by the repo file's modification time being different right after writing and when retrieving all files during the next sync. This means that two syncs are required before Orgzly considers the book to not have any changes. More importantly, if I make a change in Orgzly, sync, and then make another change in Orgzly, upon the next sync I get a "both local and remote notebook have been modified" error for the book in question... Which obviously renders this setup pretty useless, in its current state. Are you seeing the same behaviour, @sethidden? It seems like something that should cause syncing trouble pretty quickly. The issue does not appear when using a local directory repo (folder on the phone) or a regular WebDAV repo with the same servers. So it seems to be related to the interactions between Orgzly, Android, DAVx5, and the WebDAV server. We use the same DocumentFile method for retrieving the file's modification time in both occasions, and the same DocumentFile URI, so something happens to the "file" (DocumentFile) in the meantime. I tried two different WebDAV servers, one local minimal implementation (dave) and one cloud-based, and both behave the same way. |
Beta Was this translation helpful? Give feedback.
-
I haven't come across an issue where my changes were lost. I do get the "both local and remote notebook have been modified errors" frequently but then I just force upload to remote. I use Orgzly purely on my phone lately rsther than with my phone and Emacs as in the past, so I can get away with that.
I'm using mailbox.org's WebDAV server. I'm nit sure whats the underlying implementation.
…On September 7, 2024 2:08:52 PM GMT+02:00, Victor Andreasson ***@***.***> wrote:
I've noticed a problem with this kind of setup, unrelated to subfolders (it exists in 1.8.26).
When syncing local changes, everything looks good, but upon the next sync, the book is loaded from the repository, instead of showing the "no changes" status. It is caused by the repo file's modification time being different right after writing and when retrieving all files during the next sync.
This means that two syncs are required before Orgzly considers the book to not have any changes. More importantly, if I make a change in Orgzly, sync, and then make another change in Orgzly, upon the next sync I get a "both local and remote notebook have been modified" error for the book in question... Which obviously renders this setup pretty useless, in its current state.
Are you seeing the same behaviour, @sethidden? It seems like something that should cause syncing trouble pretty quickly.
The issue does not appear when using a local directory repo (folder on the phone) or a regular WebDAV repo with the same servers. So it seems to be related to the interactions between Orgzly, Android, DAVx5, and the WebDAV server. We use the same DocumentFile method for retrieving the file's modification time in both occasions, and the same DocumentFile URI, so something happens to the file in the meantime.
I tried two different WebDAV servers, one local minimal implementation ([dave](https://github.com/micromata/dave)) and one cloud-based, and both behave the same way.
--
Reply to this email directly or view it on GitHub:
#304 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I think I found the cause. Both WebDAV servers that I used seem to store modification times in seconds, whereas Android stores them in milliseconds. On the WebDAV server, the time is rounded up to the next second, and this is why we get a diff later, because the WebDAV server reports a different timestamp. If I'm right, it should be easy to solve this by always rounding up mtime (or revision, or both) to the nearest second - at least when making this comparison between last seen file revision and the latest one in the repo. |
Beta Was this translation helpful? Give feedback.
-
Perhaps not directly related to the question but potentially useful alternative. I've moved away from using WebDAV exactly because of the issues mentioned. I find explicit synchronization using |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I noticed that Davx5 supports webdav https://manual.davx5.com/webdav_mounts.html
Material Files similarly allows you to connect to a remote SFTP, Samba or WebDAV mount
That left me wondering - is keeping the WebDAV sync repository implementation within Orgzly Revived still necessary? I can just set up webdav within davx5 - that will create a new filesystem within Android. I can then use that webdav mount with Orgzly Revived using the "local" repository, rather than the webdav one.
This is the approach used by KeePassDX - https://github.com/Kunzisoft/KeePassDX/wiki/File-Manager-and-Sync, where it doesn't implement any file syncing protocol, but instead expects an external program (Syncthing, Material Files) to provide file access.
I don't really have any serious thoughts on the matter, just wanted to start the discussion
Beta Was this translation helpful? Give feedback.
All reactions