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

fix: Chunked Upload V2 not working on Nextcloud 30 and later #324

Merged
merged 2 commits into from
Jan 12, 2025

Conversation

DrZoidberg09
Copy link
Contributor

Previously the chunk number started with 0, which leads to errors. Simple fix: starting chunk number with 1

Fixes: #319

DrZoidberg09 and others added 2 commits January 5, 2025 12:00
Previously the chunk number started with 0, which leads to errors.
Simple fix: starting chunk number with 1

Fixes: cloud-py-api#319 

Signed-off-by: DrZoidberg09 <[email protected]>
Copy link

codecov bot commented Jan 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.68%. Comparing base (2cbf584) to head (77ebaa3).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #324   +/-   ##
=======================================
  Coverage   94.68%   94.68%           
=======================================
  Files          46       46           
  Lines        5364     5365    +1     
=======================================
+ Hits         5079     5080    +1     
  Misses        285      285           
Files with missing lines Coverage Δ
nc_py_api/files/files.py 100.00% <100.00%> (ø)

@bigcat88
Copy link
Contributor

sorry for such a big delay with the review, I have a small question - in which standard or where can I read that the chunk number should start with one?

and is it possible to get an example of code that does not work without this fix, and with it it starts to work(i would like to add it to test suite if possible)?

(I could not repeat the error from the linked issue unfortunately)

@DrZoidberg09
Copy link
Contributor Author

Thanks for looking at the PR!

It is not perfectly documented. It is mentioned in the example here: https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/chunking.html

However, the real issue comes here:

Used your lib to upload with v2 to the dev instance that is a normal Nextcloud instance using local storage. However, when using it with the production instance that uses s3 storage backend, it gives a bad request in return, if you go over the 5 mb chunk size where this lib automatically uses v2. Also described in the linked issue.

When starting the chunk number with 1, everything works fine also in the s3 backend Nextcloud instance.

As in v2 the chunks are directly uploaded to s3 (which is a huge advantage), I assume that the issue is rather the passthrough of the chunks from upload directly s3 rather than the pure upload.

Hence, it would nice if you could merge this.

@bigcat88
Copy link
Contributor

Your explanations are clear enough, thanks for the detailed description of why it won't fail in tests without this.

@bigcat88 bigcat88 merged commit 77586a5 into cloud-py-api:main Jan 12, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

files.upload_stream not working with NextCloud 30.0.2 and chunk_size >= 5 * 1024 * 1024
2 participants