Skip to content

fix(discovery): check quota before upload (during discovery)#9777

Open
solracsf wants to merge 2 commits intomasterfrom
checkQuotaBeforeUpload
Open

fix(discovery): check quota before upload (during discovery)#9777
solracsf wants to merge 2 commits intomasterfrom
checkQuotaBeforeUpload

Conversation

@solracsf
Copy link
Copy Markdown
Member

@solracsf solracsf commented Apr 2, 2026

Fixes #4580 (more an enhancement of actual behavior)

Related to nextcloud/server#51977
Related to nextcloud/server#59398

Quota is now checked during discovery, before any data is transmitted. If a file exceeds available quota it receives a DetailError immediately, with no retry scheduled. A _quotaBytesReserved counter prevents multiple files from being approved when their combined size exceeds quota.

The propagator's pre-upload guard is also improved: it now walks the folder hierarchy to find the nearest quota entry, and the propagator is seeded with PROPFIND quota data at the start of each cycle. Combined with nextcloud/server#59398 and nextcloud/groupfolders#4539 this makes this behavior almost full proof.

4 new tests cover: single file blocked, unknown quota allowed, chunked upload blocked, and two files exceeding combined quota.

@solracsf solracsf force-pushed the checkQuotaBeforeUpload branch from 114c6ee to 1f866cb Compare April 2, 2026 13:56
@solracsf solracsf changed the title fix(discovery): check quota before upload fix(discovery): check quota before upload (during discovery) Apr 2, 2026
@solracsf solracsf force-pushed the checkQuotaBeforeUpload branch 3 times, most recently from 091d2a9 to 399b158 Compare April 3, 2026 05:42
@solracsf solracsf marked this pull request as ready for review April 3, 2026 06:08
@solracsf
Copy link
Copy Markdown
Member Author

solracsf commented Apr 3, 2026

solar-scanner missing is out of scope of this PR
(#9786 should fix it)

@mgallien
Copy link
Copy Markdown
Collaborator

mgallien commented Apr 3, 2026

solar-scanner missing is out of scope of this PR (#9786 should fix it)

sorry for the mess
my bad

@mgallien mgallien force-pushed the checkQuotaBeforeUpload branch from 399b158 to e425898 Compare April 3, 2026 08:35
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
@solracsf solracsf force-pushed the checkQuotaBeforeUpload branch from e425898 to dcb2b54 Compare April 3, 2026 09:24
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

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

Digest: sha256:827461c2f2400b34459144223dd6997c57b2811085bc67b6f13ab742cc53fe5f

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

sonarqubecloud bot commented Apr 3, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
D Maintainability Rating on New Code (required ≥ A)
E Reliability Rating on New Code (required ≥ A)
104 New Code Smells (required ≤ 0)
1 New Bugs (required ≤ 0)

See analysis details on SonarQube Cloud

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

@solracsf
Copy link
Copy Markdown
Member Author

solracsf commented Apr 3, 2026

Every remaining SonarCloud issues are pre-existing code that SonarQube is classifying as "new" because our modifications shifted line numbers of otherwise untouched code into its diff window.

The Quality Gate cannot be cleared by fixing code in this PR.

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.

Check for server quota before trying to upload files

2 participants