[PB-4662]: fix/nautilus-webdav-client-bug #414
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


In this pr there is two main fixes in order to fix the navigation with nautilus file explorer:
No trailing Slash While PROPFIND request:
Debugging I found that the nautilus file explorer does not attach a trailing slash while performing PROPFIND requests. In order to fix this I needed the change the way we diferenciated a file from a folder and move the check from the parsing (on getRequestedResource) To the getDriveItemFromResource method.
Essentially, what I changed is that since we cannot guarantee that a requested item is either a folder or a file because of the trailing slash, now we directly fetch for folder if a trailing slash comes on the request, otherwise we "optimistically" assume that it is a file and we fetch for it, if we cant find a file item, then we will fetch for the folder instead.
Change in the PROPFIND response from 207 multistatus to 404:
While navigating and testing in nautilus file explorer i found out an error that got the file explorer stuck in an infinite loop, and that was mainly because we where sending a 207 multistatus response and this led to think the nautilus file explorer that the destination folder already had a file with that name.
Quoting RFC 4918
it is safe to assume that we should always return a 207 with the necessary response then, but this led to an infinite loop.
Also, on another paragraph:
So this lead me tho think that while it is true about the 207 multistatus response with each individual property of a resource, if there is no resource to retrieve, then we should send a 404 and we are still rfc compliant because of this sentence:
Clients tested
I have succesfully tested with:
and all operations seems to work as intended. I even did a 500mb Sync operation with multiple nested folders and files and seems to be working as usual, with a total upload time of the version 1.5.8 of ~21 Minutes and with the introduced changes of ~22 Minutes, both with an average of 400 KiB/s