orgzly-revived / orgzly-android-revived

Outliner for taking notes and managing to-do lists
https://www.orgzlyrevived.com
GNU General Public License v3.0
671 stars 42 forks source link

WebDAV sync doesn't work if there's a space in the folder name. #380

Open r4dian opened 1 month ago

r4dian commented 1 month ago

When you have a folder named org files:

  1. If you set the URL in Orgzly as https://███████.cloud/remote.php/dav/files/████%40████████.co.uk/org files (with the space) then "Test Connection" fails
  2. If you set the URL in Orgzly as https://███████.cloud/remote.php/dav/files/████%40████████.co.uk/org%20files (with %20 where the space would go) then "Test Connection" succeeds & finds the correct amount of note books, then when you try to sync each one appears, but gets error 404 & can't sync.
  3. If you leave the folder off the URL and tick the use subfolders option, the result is the same as 2, and you can see the URL for each file is using org%20files/ as the folder name.

Please complete the following information:

Device: Sony Xperia 10 III (aka XQ-BT52)
Android Version: 13
Orgzly Revived Version: 1.8.28 (via f-droid )
Sync repository type (directory/Dropbox/WebDAV/Git): WebDAV

I missed several updates cos I didn't know f-droid had newer versions than one I was on, so unfortunately don't know in which version this broke.

image

amberin commented 1 month ago

Thanks for reporting, if this used to work then it's pretty serious. I'll look into it ASAP.

r4dian commented 1 month ago

I last used it this way in Orgzly (RIP) rather than Orgzly Revived & have been syncing it thorough the Nextcloud app since.

Forge36 commented 1 week ago

There's a mention of fixing a bug with spaces in URLs with a dependency:

https://github.com/thegrizzlylabs/sardine-android/commit/5d7883cef19b2753c6e508a2febb44084a7ea8c2

amberin commented 4 days ago

@r4dian So the server is backed by Nextcloud? I'm seeing the same issue with a Nextcloud instance, and I believe the problem is not Orgzly, but rather that Nextcloud hands out WebDAV URLs where the @ is correctly encoded (into %40), but then it advertises the DAV resources (files) with an unencoded @ in their URLs. In other words, Nextcloud is being inconsistent, and there is no reasonable/reliable way for Orgzly to work around that.

I got rid of the problem by using @ instead of %40 in the Orgzly WebDAV repository URL.

If we are having the same issue, then the spaces are not the problem -- they should always be encoded in a URL, so your scenario no. 1 is just wrong.