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: also add X-OC-Mtime header to final chunks move #1038

Merged
merged 1 commit into from
Jan 10, 2024
Merged

Conversation

skjnldsv
Copy link
Contributor

@skjnldsv skjnldsv commented Jan 9, 2024

Fix #1032

@skjnldsv skjnldsv added bug Something isn't working 3. to review Waiting for reviews labels Jan 9, 2024
@skjnldsv skjnldsv requested a review from artonge January 9, 2024 18:07
@skjnldsv skjnldsv self-assigned this Jan 9, 2024
@skjnldsv skjnldsv requested a review from susnux January 9, 2024 18:07
Copy link

codecov bot commented Jan 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9c8566d) 91.25% compared to head (6c5f023) 91.25%.
Report is 6 commits behind head on master.

❗ Current head 6c5f023 differs from pull request most recent head 9b3ee04. Consider uploading reports for the commit 9b3ee04 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1038   +/-   ##
=======================================
  Coverage   91.25%   91.25%           
=======================================
  Files           3        3           
  Lines          80       80           
  Branches       16       16           
=======================================
  Hits           73       73           
  Misses          4        4           
  Partials        3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -242,6 +242,8 @@ export class Uploader {
method: 'MOVE',
url: `${tempUrl}/.file`,
headers: {
'X-OC-Mtime': file.lastModified / 1000,
'OC-Total-Length': file.size,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this related? how did it work previously?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that @artonge also added this. I figured that while X-OC-Mtime was at stake here, maybe the same problem was also applying to the total lengh?
And bingo! It was, we also need it for the MOVE

https://github.com/nextcloud/server/blob/1719440079926ddd8fcbbc5bad76fda3fb21efad/apps/dav/lib/Upload/ChunkingPlugin.php#L58-L75
https://github.com/nextcloud/server/blob/1719440079926ddd8fcbbc5bad76fda3fb21efad/apps/dav/lib/Upload/ChunkingPlugin.php#L118-L119

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just curious because it was not mentioned in the commit so not sure if related.
But makes sense :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And bingo! It was, we also need it for the MOVE

@skjnldsv that is the legacy chunking upload, so if we use v2 we do not need it 😉

Copy link
Contributor Author

@skjnldsv skjnldsv Jan 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And bingo! It was, we also need it for the MOVE

@skjnldsv that is the legacy chunking upload, so if we use v2 we do not need it 😉

Nope, the chunkingV2 is used for Object storage only :)

EDIT: see https://github.com/nextcloud/server/blob/1719440079926ddd8fcbbc5bad76fda3fb21efad/apps/dav/lib/Upload/ChunkingV2Plugin.php#L286

…nks move

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
@skjnldsv skjnldsv merged commit 851f87b into master Jan 10, 2024
13 checks passed
@skjnldsv skjnldsv deleted the fix/mtime branch January 10, 2024 07:32
@susnux susnux mentioned this pull request Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modification time is not set correctly for chunked uploads
2 participants