ocis: Broken tests in drop zone in reva master
in https://github.com/cs3org/reva/pull/3469, to not override files having the same names in a drop zone, we are appending an uuid at the end of a file name. This is unfortunately breaking some acceptance tests, like for example this scenario (from https://drone.cernbox.cern.ch/cs3org/reva/9673/10/6):
Scenario: Uploading same file to a public upload-only share multiple times via new API
# The new API does the autorename automatically in upload-only folders
Given user "Alice" has created a public link share with settings
| path | FOLDER |
| permissions | create |
When the public uploads file "test.txt" with content "test" using the new public WebDAV API
And the public uploads file "test.txt" with content "test2" using the new public WebDAV API
Then the HTTP status code of responses on all endpoints should be "201"
And the following headers should match these regular expressions
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And the content of file "/FOLDER/test.txt" for user "Alice" should be "test"
And the content of file "/FOLDER/test (2).txt" for user "Alice" should be "test2"
Now, this test is supposed to check for a file containing a number (2), that didn’t override the original file. But even testing in https://ocis.owncloud.com this does not happen, and the original file is overwritten. So which is the expected behavior in OCIS? We would like than to modify the test for reva master to pass the PR @phil-davis
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 18 (16 by maintainers)
@phil-davis Maybe having only the 26 letters is enough. Only, even if the code checks before uploading that the file already exists, this does not guarantee to not have collisions. I propose instead to enforce the if_not_exist flag in the
InitiateFileUpload
(https://cs3org.github.io/cs3apis/#cs3.storage.provider.v1beta1.InitiateFileUploadRequest), and report to the user to retry again the upload. In fact, some storage providers (see EOS), cache locally the file, before finally uploading to the remote storage, making it impossible to retry with a different file name (as the stream has been already consumed).Is this a duplicate of https://github.com/owncloud/web/issues/7643 ?