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(quota): automatically detect chunk quota with OC-Total-Length header #42679

Merged
merged 1 commit into from Jan 11, 2024

Conversation

skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Jan 10, 2024

Problem

When uploading chunks, legacy old methods had a dedicated oc-chunked header which is NOT used anymore
There was some specific name pattern to follow and the new chunk uploading is much simpler

Solution

Because we also send the OC-Total-Length header, we can actually check the quota from the first uploaded chunk.

Results

With nextcloud-libraries/nextcloud-upload#1042

Before After
2024-01-10_12-53 2024-01-10_12-53_1

Fix #40702

apps/dav/lib/Connector/Sabre/QuotaPlugin.php Dismissed Show dismissed Hide dismissed
* the quota on the target destination.
*
* @param string $source source path
* @param string $destination destination path
*/
public function beforeMove($source, $destination) {
$sourceNode = $this->server->tree->getNodeForPath($source);
public function beforeMove(string $sourcePath, string $destinationPath) {

Check notice

Code scanning / Psalm

MissingReturnType Note

Method OCA\DAV\Connector\Sabre\QuotaPlugin::beforeMove does not have a return type, expecting bool|null
…eader

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
@juliushaertl juliushaertl merged commit f8625cf into master Jan 11, 2024
50 of 51 checks passed
@juliushaertl juliushaertl deleted the fix/chunked-quota branch January 11, 2024 11:01
@skjnldsv skjnldsv added the pending documentation This pull request needs an associated documentation update label Jan 11, 2024
@skjnldsv skjnldsv removed the pending documentation This pull request needs an associated documentation update label Jan 11, 2024
@skjnldsv
Copy link
Member Author

Docs update nextcloud/documentation#11432

@blizzz blizzz mentioned this pull request Mar 5, 2024
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.

Enhance our of quota check
3 participants