WebDAVDeleteJob fails deleting folders when a syncAttribute is specified
When using a WebDAVDeleteJob
to remove a remote folder and specifying a sync attribute (i.e. an etag
), the deletion fails (with a precondition-failed
HTTP error, which indicates that the etag
no longer matches). However, the etag
in this particular case did not change!
Hence, it seems something is odd when using etags
with deletions of folders, in case with the WebDAV implementations that we cover in our unit tests (i.e. against NextCloud and ownCloud).
Currently, due to this, we will do an unconditional deletion of remote folders during a sync (with a previous list-operation run to make sure the remote folder is empty). This should reduce the number of issues we encounter, however, ideally remote deletion with etags
should work. We should look into why this happens and if possible implement a fix.
If this turns out to be inherent to WebDAV:
Either we find another solution (like using locks?) or at least allow the DirectorySynchronizer
to be configured so it won't set the sync properties when deleting folders.