android-library icon indicating copy to clipboard operation
android-library copied to clipboard

Handle propfind replies with status 425 as valid

Open jesmrec opened this issue 1 year ago • 5 comments

Comes from https://github.com/owncloud/client/pull/10103

PROPFIND response 425 should be valid and not error.

jesmrec avatar Oct 04 '22 09:10 jesmrec

Required:

  • If propfind over file responses 425, file is shown in the list (while postprocessing)
  • No errors displayed

jesmrec avatar Oct 06 '22 07:10 jesmrec

I managed to reproduce the problem in the specific instance.

  1. Select file to upload
  2. File uploading in uploads view
  3. File finishes to upload

Then, file is shown in the filelist without errors, even when the PROPFIND returns 425 (checked with curl command)

Bad thing: the file is shown like a folder with date 1/1/1970.

Screenshot 2022-10-06 at 13 06 58

When PROPFIND returns 200 again, it is correctly shown with the thumbnail etc...

Screenshot 2022-10-06 at 13 09 14

But...in the following update (by browsing or pulling to refresh) file is automatically downloaded. I guess that some difference between local and remote timestamp caused by the postprocessing triggers a sync, and file is downloaded.

@michaelstingl is this valid ftm? should the team check deeply to improve the behaviour?

Tested with Android app 2.21.2 (08b9fc389)

jesmrec avatar Oct 06 '22 11:10 jesmrec

@jesmrec please post curl request and response while processing and after processing

michaelstingl avatar Oct 06 '22 14:10 michaelstingl

I noticed that the file is downloaded afterwards only if it is not in root folder. Here we have both cases:

  1. File uploaded to root folder -> file is not downloaded after postprocessing

curl request:

curl -k -u einstein:relativity -H 'Content-Length:0' -X PROPFIND 'https://xx.xx.xx.xx:9200/remote.php/dav/files/einstein/20220929_093503.jpg'

Response while processing:

<d:multistatus
	xmlns:s="http://sabredav.org/ns"
	xmlns:d="DAV:"
	xmlns:oc="http://owncloud.org/ns">
	<d:response>
		<d:href>/remote.php/dav/files/einstein/20220929_093503.jpg</d:href>
		<d:propstat>
			<d:prop>
				<oc:id>1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51!02f88238-4432-4619-9956-4fe01bb02361</oc:id>
				<oc:fileid>1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51!02f88238-4432-4619-9956-4fe01bb02361</oc:fileid>
				<oc:spaceid>4c510ada-c86b-4815-8820-42cdf82c3d51</oc:spaceid>
				<oc:name>20220929_093503.jpg</oc:name>
				<d:getetag>"cb53aaac71635cc7565ea2b4984db09f"</d:getetag>
				<oc:permissions>RDNVW</oc:permissions>
				<d:resourcetype></d:resourcetype>
				<d:getcontentlength>2543263</d:getcontentlength>
				<d:getcontenttype>image/jpeg</d:getcontenttype>
				<d:getlastmodified>Fri, 07 Oct 2022 06:40:47 GMT</d:getlastmodified>
				<oc:checksums>
					<oc:checksum>SHA1:4f2ac5d98ad1de656599adea5fc1b3063b5fb684 MD5:9097cb32bc0f5a3e75ecd3d2ef0c7d3c ADLER32:4e0a17ba</oc:checksum>
				</oc:checksums>
				<oc:tags></oc:tags>
				<oc:favorite>0</oc:favorite>
			</d:prop>
			<d:status>HTTP/1.1 425 TOO EARLY</d:status>
		</d:propstat>
	</d:response>
</d:multistatus>

Response after processing:

<d:multistatus
	xmlns:s="http://sabredav.org/ns"
	xmlns:d="DAV:"
	xmlns:oc="http://owncloud.org/ns">
	<d:response>
		<d:href>/remote.php/dav/files/einstein/20220929_093503.jpg</d:href>
		<d:propstat>
			<d:prop>
				<oc:id>1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51!02f88238-4432-4619-9956-4fe01bb02361</oc:id>
				<oc:fileid>1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51!02f88238-4432-4619-9956-4fe01bb02361</oc:fileid>
				<oc:spaceid>4c510ada-c86b-4815-8820-42cdf82c3d51</oc:spaceid>
				<oc:name>20220929_093503.jpg</oc:name>
				<d:getetag>"2fa247bd025b33a9efc571e8d5b721ef"</d:getetag>
				<oc:permissions>RDNVW</oc:permissions>
				<d:resourcetype></d:resourcetype>
				<d:getcontentlength>2543263</d:getcontentlength>
				<d:getcontenttype>image/jpeg</d:getcontenttype>
				<d:getlastmodified>Fri, 07 Oct 2022 06:40:45 GMT</d:getlastmodified>
				<oc:checksums>
					<oc:checksum>SHA1:4f2ac5d98ad1de656599adea5fc1b3063b5fb684 MD5:9097cb32bc0f5a3e75ecd3d2ef0c7d3c ADLER32:4e0a17ba</oc:checksum>
				</oc:checksums>
				<oc:tags></oc:tags>
				<oc:favorite>0</oc:favorite>
			</d:prop>
			<d:status>HTTP/1.1 200 OK</d:status>
		</d:propstat>
	</d:response>
</d:multistatus>
  1. File uploaded to non-root folder -> file is downloaded after postprocessing

curl request:

curl -k -u einstein:relativity -H 'Content-Length:0' -X PROPFIND 'https://xx.xx.xx.xx:9200/remote.php/dav/files/einstein/Test/20220929_093503.jpg'

Response while processing:

<d:multistatus
	xmlns:s="http://sabredav.org/ns"
	xmlns:d="DAV:"
	xmlns:oc="http://owncloud.org/ns">
	<d:response>
		<d:href>/remote.php/dav/files/einstein/Test/20220929_093503.jpg</d:href>
		<d:propstat>
			<d:prop>
				<oc:id>1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51!84c3a874-63af-45be-939d-8075ab828a20</oc:id>
				<oc:fileid>1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51!84c3a874-63af-45be-939d-8075ab828a20</oc:fileid>
				<oc:spaceid>4c510ada-c86b-4815-8820-42cdf82c3d51</oc:spaceid>
				<oc:name>20220929_093503.jpg</oc:name>
				<d:getetag>"836547f6df9f65b3037d19f45f0fc10f"</d:getetag>
				<oc:permissions>RDNVW</oc:permissions>
				<d:resourcetype></d:resourcetype>
				<d:getcontentlength>2543263</d:getcontentlength>
				<d:getcontenttype>image/jpeg</d:getcontenttype>
				<d:getlastmodified>Fri, 07 Oct 2022 06:53:46 GMT</d:getlastmodified>
				<oc:checksums>
					<oc:checksum>SHA1:4f2ac5d98ad1de656599adea5fc1b3063b5fb684 MD5:9097cb32bc0f5a3e75ecd3d2ef0c7d3c ADLER32:4e0a17ba</oc:checksum>
				</oc:checksums>
				<oc:tags></oc:tags>
				<oc:favorite>0</oc:favorite>
			</d:prop>
			<d:status>HTTP/1.1 425 TOO EARLY</d:status>
		</d:propstat>
	</d:response>
</d:multistatus>

Response after processing:

<d:multistatus
	xmlns:s="http://sabredav.org/ns"
	xmlns:d="DAV:"
	xmlns:oc="http://owncloud.org/ns">
	<d:response>
		<d:href>/remote.php/dav/files/einstein/Test/20220929_093503.jpg</d:href>
		<d:propstat>
			<d:prop>
				<oc:id>1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51!84c3a874-63af-45be-939d-8075ab828a20</oc:id>
				<oc:fileid>1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51!84c3a874-63af-45be-939d-8075ab828a20</oc:fileid>
				<oc:spaceid>4c510ada-c86b-4815-8820-42cdf82c3d51</oc:spaceid>
				<oc:name>20220929_093503.jpg</oc:name>
				<d:getetag>"95e661b3153276f45d9a470ed20b5bf6"</d:getetag>
				<oc:permissions>RDNVW</oc:permissions>
				<d:resourcetype></d:resourcetype>
				<d:getcontentlength>2543263</d:getcontentlength>
				<d:getcontenttype>image/jpeg</d:getcontenttype>
				<d:getlastmodified>Fri, 07 Oct 2022 06:53:45 GMT</d:getlastmodified>
				<oc:checksums>
					<oc:checksum>SHA1:4f2ac5d98ad1de656599adea5fc1b3063b5fb684 MD5:9097cb32bc0f5a3e75ecd3d2ef0c7d3c ADLER32:4e0a17ba</oc:checksum>
				</oc:checksums>
				<oc:tags></oc:tags>
				<oc:favorite>0</oc:favorite>
			</d:prop>
			<d:status>HTTP/1.1 200 OK</d:status>
		</d:propstat>
	</d:response>
</d:multistatus>

jesmrec avatar Oct 07 '22 06:10 jesmrec

There was a bug in the etag propagation, causing the files etag to change after postprocessing. The fix landed today, so etag will not change any more.

kobergj avatar Oct 10 '22 13:10 kobergj