Skip to content

Conversation

@felixn
Copy link

@felixn felixn commented Jan 26, 2019

Fix for #10862

The method used by Trashbin.php to calculate used space included external storage, while the quota doesn't include external storage. This led to $free space always being way too small (or negative), leading trashbin to purge all deleted files.

The calculation for used space, free space and quota was replaced by the version used by the Versions app:

$files_view = new View('/' . $uid . '/files');
$rootInfo = $files_view->getFileInfo('/', false);
$free = $quota - $rootInfo['size']; // remaining free space for user

@GAS85
@MorrisJobke
@danielkesselberg

…ge (doesn't count towards quota)

Signed-off-by: Felix Nieuwenhuizen <[email protected]>
@rullzer
Copy link
Member

rullzer commented Jan 30, 2019

I'm not a big fan of reverting back to the view. The node API is cleaner IMO. But if there is no other way.

@icewind1991 I leave this to your expertise.

@rullzer
Copy link
Member

rullzer commented Jan 30, 2019

And thanks a lot for your pr @felixn! welcome!

@MorrisJobke MorrisJobke added this to the Nextcloud 16 milestone Jan 30, 2019
@icewind1991
Copy link
Member

I think this is fine to backport to stable15, then for 16 we can extend the node api to provide this info

@MorrisJobke MorrisJobke merged commit 3459ffc into nextcloud:master Feb 27, 2019
@welcome
Copy link

welcome bot commented Feb 27, 2019

Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22
Most developers hang out on IRC. So join #nextcloud-dev on Freenode for a chat!

@MorrisJobke
Copy link
Member

/backport to stable15

@MorrisJobke
Copy link
Member

/backport to stable14

@backportbot-nextcloud
Copy link

backport to stable14 in #14415

@backportbot-nextcloud
Copy link

backport to stable15 in #14414

@icewind1991
Copy link
Member

node api extension: #14412

@felixn felixn deleted the bugfix/10862-trash-bin-ignores-trashbin_retention_obligation branch February 27, 2019 17:53
@MorrisJobke
Copy link
Member

Revert of this with the usage of the new API from #14412 can be found at #14454

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.

4 participants