Skip to content

fix(propagateupload): ensure file size stays the same for new uploads#9823

Open
nilsding wants to merge 2 commits intomasterfrom
bugfix/9271/check-for-filesize-during-uploads
Open

fix(propagateupload): ensure file size stays the same for new uploads#9823
nilsding wants to merge 2 commits intomasterfrom
bugfix/9271/check-for-filesize-during-uploads

Conversation

@nilsding
Copy link
Copy Markdown
Member

@nilsding nilsding commented Apr 10, 2026

It is possible that the sync engine discovers a new file with a small enough file size to use the old V1 upload propagator. This is fine unless the file is still being written to between discovery and propagation (this could happen when copying large files); should the file grow large enough before propagation starts the propagator job may attempts to upload the file in chunks using the old (removed with Nextcloud 30) chunking mechanism. Since Nextcloud 30 this no longer works as it only has support for V2 upload chunking (PropagateUploadFileNG), resulting in broken partial uploads while the client believes everything got uploaded.

The PropagateUploadFileCommon job already checks whether the file is different, however relying on just the mtime is not enough for newly discovered files.

Resolves #9271

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
It is possible that the sync engine discovers a file with a small enough
file size to use the old V1 upload propagator.  This is fine unless the file
size is still growing between discovery and propagation; should the file grow
large enough before propagation starts the propagator job may attempts to
upload the file in chunks using the old (removed with Nextcloud 30) chunking
mechanism.  Since Nextcloud 30 this no longer works as it only has support for
V2 upload chunking (PropagateUploadFileNG), resulting in broken partial
uploads while the client believes everything got uploaded.

The PropagateUploadFileCommon job already checks whether the file is
different, however relying on just the mtime is not enough for new files.

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
@nilsding nilsding self-assigned this Apr 10, 2026
@nilsding
Copy link
Copy Markdown
Member Author

/backport to stable-33.0 please

@nilsding
Copy link
Copy Markdown
Member Author

/backport to stable-4.0

@github-actions
Copy link
Copy Markdown

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

Digest: sha256:cc0cb61fdfb19a128157664670a55ab97f04a7adbd648025e8946af5fa5af1b1

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.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
10 New Code Smells (required ≤ 0)
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Upload chunking stuck / failed - destroyed file

1 participant