Home / GitHub Page

Sync target upgrade and webdav api

Dear Laurent

Since we’re using our own webdav back-end for synchronization, it would be nice to have documented what the client expects from the webdav server.

Currently AFAIR I’m supporting GET, PUT and PROPFIND, serving the notes as a flat directory of some_hash_string.md files plus the two directories .sync and .resource, the last of which contains resources pointed to by the md files. The md files themselves contain metadata at the end, in the form of key:value lines. One key is _type, with values 1-5, with 1 indicating a normal note, 2 indicating a folder, 4 a media resource (with id indicating the corresponding file in the .resource directory) etc.

Again, it would be really nice to have this API documented and changes to it announced well in advance of updating the clients.

Currently I don’t expect our back-end to support the updated clients, so I recommend users to not upgrade.

Thanks for your efforts,
Frederik

Dear Frederick,

You’re right, I hadn’t thought about this, and indeed for now it’s best if your users stay with the previous version.

The new sync target format is not significantly different from the previous one and is described in the test units, but I’ll get back to you with more info.

I’m not sure how to announce this sort of changes though, maybe with a post in the forum? But I don’t know if all concerned users will see it.

Just some additional info to make it easier when you decide to upgrade:

Currently AFAIR I’m supporting GET, PUT and PROPFIND, serving the notes as a flat directory of some_hash_string.md files plus the two directories .sync and .resource, the last of which contains resources pointed to by the md files. The md files themselves contain metadata at the end, in the form of key:value lines. One key is _type, with values 1-5, with 1 indicating a normal note, 2 indicating a folder, 4 a media resource (with id indicating the corresponding file in the .resource directory) etc.

All this is still correct. In general what’s changed for this version is this:

  • There’s a locks folder (which is used to lock a sync target during an upgrade)
  • There’s a .resource folder (like before)
  • There’s a temp folder
  • There’s an info.json file with content {"version": 2}
  • There’s still a .sync/version.txt file, but now the content is “2” (this file is kept to notify old clients that this is a new sync target structure)
  • Therer’s no change to the way notes, notebooks, etc. are stored

If you need some more information please let me know.