-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Fixes incorrect "free" value in stat #44274
Fixes incorrect "free" value in stat #44274
Conversation
@hopleus please remove the merge commits, if you want to keep your PR up to date, please use rebase to master instead 🙏 EDIT: I did it for you :) |
Signed-off-by: hopleus <[email protected]>
2811068
to
c6a32b6
Compare
I am very grateful to you. In the future, I will keep in mind |
|
||
// So that the front does not react to a negative free space value and does not show appropriate warnings | ||
if ($free === \OCP\Files\FileInfo::SPACE_UNKNOWN | ||
|| $free === \OCP\Files\FileInfo::SPACE_UNLIMITED | ||
|| $free === \OCP\Files\FileInfo::SPACE_NOT_COMPUTED) { | ||
$free = PHP_INT_MAX; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure I like doing that here. It might break other code paths expecting to get the information when the free space is unknown.
Couldn’t the frontend be adapted instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The frontend should be adjusted instead to handle these values instead
Related front-end PR #43666 |
Summary
Fixed the problem with incorrect output of "free" when receiving stat
Use case
If you connect an ObjectStore, for example S3, and do not set a quota for the user, then NextCloud returns the total free space, and since the ObjectStore is connected, "-2" (SPACE_UNKNOWN) is returned. When the frontend receives data, it relies on the "free" field to display a warning about the lack of disk space, which is not correct, because there is disk space, but it cannot be obtained due to the connected ObjectStore.
Checklist