Skip to content

Improved upload chunk integrity - #10377

Merged
i2h3 merged 1 commit into
masterfrom
i2h3/upload-chunk-integrity
Jul 16, 2026
Merged

Improved upload chunk integrity#10377
i2h3 merged 1 commit into
masterfrom
i2h3/upload-chunk-integrity

Conversation

@i2h3

@i2h3 i2h3 commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Fixes a chunked-upload integrity bug in the macOS File Provider extension that affects large files (>100 MiB, e.g. Adobe InDesign/Illustrator documents). Previously the chunk-upload identifier diverged across a file's lifecycle — setStatusForItemMetadata minted a fresh UUID on every .uploading transition while modifyContents passed a stale, pre-transition value to the uploader — so an interrupted transfer never actually resumed (it re-uploaded from scratch and leaked both local chunk records and the server-side upload folder), and because chunks carried no binding to the content they came from, a resumed upload whose source had since changed could splice stale server-side chunks into the new version and silently produce a corrupted file. The chunk identifier is now derived deterministically from (itemIdentifier, fileSize, modificationDate): identical content re-uploads under the same id so an interrupted transfer correctly resumes and reuses the chunks already stored, while any content change yields a new id (and a fresh server folder), guaranteeing old chunks can never be mixed into a different version; the item's stale chunk bookkeeping is swept before each upload. The now-redundant chunkUploadId churn was removed from setStatusForItemMetadata (the Realm field is left in place, so there is no schema migration). This is covered by the resume tests for the create and modify paths (rewritten for the derived id) plus a new test asserting that a content change discards the prior chunks and starts fresh; the full test suite (315 tests) passes.

Checklist

AI (if applicable)

@i2h3 i2h3 added this to the 34.0.0 milestone Jul 15, 2026
@i2h3 i2h3 self-assigned this Jul 15, 2026
@i2h3 i2h3 added bug os: 🍎 macOS Apple macOS, formerly also known as OS X feature: 📁 file provider macOS File Provider Extension, more general also known as virtual file system. labels Jul 15, 2026
@github-project-automation github-project-automation Bot moved this to 🧭 Planning evaluation (don't pick) in 💻 Desktop Clients team Jul 15, 2026
@i2h3

i2h3 commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

/backport to stable-34.0

@i2h3 i2h3 moved this from 🧭 Planning evaluation (don't pick) to 🏗️ In progress in 💻 Desktop Clients team Jul 15, 2026
@i2h3

i2h3 commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

This depends on #10369 because it also fixes tests which are flaky master-wide.

@sonarqubecloud

Copy link
Copy Markdown

@i2h3
i2h3 force-pushed the i2h3/upload-chunk-integrity branch from 0fb3773 to 19b4bc3 Compare July 16, 2026 07:46
Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
@i2h3
i2h3 force-pushed the i2h3/upload-chunk-integrity branch from 19b4bc3 to 9e91734 Compare July 16, 2026 07:46
@github-actions

Copy link
Copy Markdown
Contributor

Artifact containing the AppImage: nextcloud-appimage-pr-10377.zip

Digest: sha256:518e397798e50640a3d378fc9c23ef9fe9d33f1c076fd78b2e53c43d814b3d8e

To test this change/fix you can download the above artifact file, unzip it, and run it.

Please make sure to quit your existing Nextcloud app and backup your data.

@i2h3
i2h3 merged commit cd323c3 into master Jul 16, 2026
20 of 21 checks passed
@i2h3
i2h3 deleted the i2h3/upload-chunk-integrity branch July 16, 2026 09:44
@github-project-automation github-project-automation Bot moved this from 🏗️ In progress to ☑️ Done in 💻 Desktop Clients team Jul 16, 2026
@mgallien mgallien modified the milestones: 34.0.0, 35.0.0 Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug feature: 📁 file provider macOS File Provider Extension, more general also known as virtual file system. os: 🍎 macOS Apple macOS, formerly also known as OS X

Projects

Status: ☑️ Done

Development

Successfully merging this pull request may close these issues.

3 participants