Skip to content

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

Merged
Rello merged 2 commits into
masterfrom
bugfix/9271/check-for-filesize-during-uploads
Jul 30, 2026
Merged

fix(propagateupload): ensure file size stays the same for new uploads#9823
Rello merged 2 commits into
masterfrom
bugfix/9271/check-for-filesize-during-uploads

Conversation

@nilsding

@nilsding nilsding commented Apr 10, 2026

Copy link
Copy Markdown
Member

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

@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

@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

@Rello Rello modified the milestones: 34.0.0, 34.0.1 Jul 20, 2026
@ai-tp

ai-tp commented Jul 27, 2026

Copy link
Copy Markdown

The issue has been open and plagueing users for several months now. But it seems almost fixed?
Could someone take another look at this?
It would be much appreciated

nilsding added 2 commits July 30, 2026 09:40
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 <[email protected]>
@nilsding
nilsding force-pushed the bugfix/9271/check-for-filesize-during-uploads branch from 987dbfe to 8ba9a83 Compare July 30, 2026 07:40
@nilsding
nilsding requested a review from claucambra as a code owner July 30, 2026 07:40
@nilsding

Copy link
Copy Markdown
Member Author

/backport to stable-34.0 please

@github-actions

Copy link
Copy Markdown
Contributor

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

Digest: sha256:adc42d2e38752397637e54d2e88790a6273f85e53aa0a32de677ed606b352f46

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
C Maintainability Rating on New Code (required ≥ A)
11 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

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

@Rello
Rello merged commit caea4e6 into master Jul 30, 2026
22 of 24 checks passed
@Rello
Rello deleted the bugfix/9271/check-for-filesize-during-uploads branch July 30, 2026 15:23
@MaxXor

MaxXor commented Jul 30, 2026

Copy link
Copy Markdown

Thanks, finally!

@CodingKoalaGeneral

Copy link
Copy Markdown

ty for fixing and merging into the master branch. I was so happy to finally be settled at my last location to work on foss and being more helpful than life happened once again and I'm now starting over in a much better area. Look before you leap or otherwise you pay twice.

nilsding pushed a commit to andreasbohl/nextcloud-desktop that referenced this pull request Jul 31, 2026
Changes:
     [sonarcloud.yml (line 4)]
     Runs after pushes to master, keeping the comparison baseline current.
     Handles draft-PR checks safely for both push and PR events.
     Cancels superseded Sonar runs for the same PR/branch.
     Removed the obsolete filesystem cache step.

     [sonar-project.properties (line 1)]
     Removed deprecated sonar.language.
     Removed duplicate and malformed cache settings.
     Removed sonar.cfamily.threads=2, allowing Sonar to use all detected logical CPUs.
     Preserved the correct coverage-report path.

     [propagateupload.cpp (line 444)]
     Fixed the one Sonar finding actually introduced by PR nextcloud#9823 by making the variable const.

Assisted-by: Codex:GPT-5
Signed-off-by: Rello <[email protected]>
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

6 participants