Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TUS folder upload issues #3458

Closed
PVince81 opened this issue May 13, 2020 · 7 comments · Fixed by #3480
Closed

TUS folder upload issues #3458

PVince81 opened this issue May 13, 2020 · 7 comments · Fixed by #3480
Assignees
Labels
Type:Bug Something isn't working

Comments

@PVince81
Copy link
Contributor

PVince81 commented May 13, 2020

Run the following Phoenix acceptance tests against OCIS:

  • tests/acceptance/features/webUIUpload/upload.feature:19

For some reason it seems that only the first file is uploaded, not sure why the second one isn't.

@PVince81 PVince81 added the Type:Bug Something isn't working label May 13, 2020
@PVince81
Copy link
Contributor Author

1) Scenario: simple upload of a folder that does not exist before # tests/acceptance/features/webUIUpload/upload.feature:19
   ✔ Before # tests/acceptance/setup.js:28
   ✔ Before # tests/acceptance/setup.js:32
   ✔ Before # tests/acceptance/setup.js:36
   ✔ Before # tests/acceptance/setup.js:46
   ✔ Before # tests/acceptance/setup.js:68
   ✔ Before # tests/acceptance/setup.js:75
   ✔ Before # tests/acceptance/stepDefinitions/filesContext.js:15
   ✔ Before # tests/acceptance/stepDefinitions/generalContext.js:191
   ✔ Before # tests/acceptance/stepDefinitions/generalContext.js:230
   ✔ Given user "user1" has been created with default attributes # tests/acceptance/stepDefinitions/provisioningContext.js:126
   ✔ And user "user1" has logged in using the webUI # tests/acceptance/stepDefinitions/loginContext.js:63
   ✔ When the user uploads a folder containing the following files in separate sub-folders using the webUI: # tests/acceptance/stepDefinitions/filesContext.js:256                                                                                                            
       | lorem.txt     |
       | new-lorem.txt |
   ✔ Then no message should be displayed on the webUI # tests/acceptance/stepDefinitions/generalContext.js:83
   ✔ And the last uploaded folder should be listed on the webUI # tests/acceptance/stepDefinitions/filesContext.js:355
   ✔ And as "user1" the last uploaded folder should exist # tests/acceptance/stepDefinitions/webdavContext.js:62
   ✖ And as "user1" the last uploaded folder should contain the following files inside the sub-folders: # tests/acceptance/stepDefinitions/webdavContext.js:66                                                                                                                
       | new-lorem.txt |
       | lorem.txt     |
       AssertionError [ERR_ASSERTION]: Could not find following files inside sub-folders of the session folder
       new-lorem.txt,lorem.txt
           + expected - actual

           -2
           +0
       
           at _callee$ (/home/vincent/Private/Work/workspace/phoenix/tests/acceptance/stepDefinitions/webdavContext.js:89:12)
           at tryCatch (/home/vincent/Private/Work/workspace/phoenix/node_modules/regenerator-runtime/runtime.js:45:40)
           at Generator.invoke [as _invoke] (/home/vincent/Private/Work/workspace/phoenix/node_modules/regenerator-runtime/runtime.js:274:22)
           at Generator.prototype.(anonymous function) [as next] (/home/vincent/Private/Work/workspace/phoenix/node_modules/regenerator-runtime/runtime.js:97:21)
           at asyncGeneratorStep (/home/vincent/Private/Work/workspace/phoenix/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
           at _next (/home/vincent/Private/Work/workspace/phoenix/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
           at process._tickCallback (internal/process/next_tick.js:68:7)
   ✔ After # tests/acceptance/stepDefinitions/provisioningContext.js:200
   ✔ After # tests/acceptance/stepDefinitions/generalContext.js:235
   ✔ After # tests/acceptance/stepDefinitions/generalContext.js:215
   ✔ After # tests/acceptance/setup.js:110
   ✔ After # tests/acceptance/setup.js:106
   ✔ After # tests/acceptance/setup.js:102
   ✔ After # tests/acceptance/setup.js:95
   ✔ After # tests/acceptance/setup.js:86
   ✔ After # tests/acceptance/setup.js:54

@PVince81
Copy link
Contributor Author

I checked the logs and actually new-lorem.txt got uploaded but there is no trace of lorem.txt.

also strange that the test result says 0 entries when I saw one entry in the folder which was "new-lorem.txt"

@PVince81
Copy link
Contributor Author

okay, so something is stuck:
image

seems the tus library is not loaded/initialized in all code paths. weird

@PVince81 PVince81 self-assigned this May 19, 2020
@PVince81
Copy link
Contributor Author

seems unrelated, I had an env issue, retrying...

@PVince81
Copy link
Contributor Author

okay, I see: the test code is sending a Depth header with a value of 2, hoping to get the sub-sub-folder values. But the ocdav service is strict.
According to the spec, only "0", "1" and "infinity" are acceptable values: https://tools.ietf.org/html/rfc4918#section-10.2

Raised owncloud/ocis-reva#212 to fix the depth header there and add some validation

@PVince81
Copy link
Contributor Author

At first I tried to fix the test to do propfinds recursively but the parsing was too cumbersome, so I ended up simply implemented depth-infinity in OCIS: cs3org/reva#758

@PVince81
Copy link
Contributor Author

PR here: #3480

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type:Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant