Fixes incorrect "free" value in stat#44274
Closed
hopleus wants to merge 1 commit intonextcloud:masterfrom
hopleus:bugfix/fix-incorrect-free-in-stats
Closed
Fixes incorrect "free" value in stat#44274hopleus wants to merge 1 commit intonextcloud:masterfrom hopleus:bugfix/fix-incorrect-free-in-stats
hopleus wants to merge 1 commit intonextcloud:masterfrom
hopleus:bugfix/fix-incorrect-free-in-stats
Conversation
Member
|
@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 <hopleus@gmail.com>
Contributor
Author
I am very grateful to you. In the future, I will keep in mind |
come-nc
reviewed
Jun 3, 2024
Comment on lines
+525
to
+531
|
|
||
| // 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; | ||
| } |
Contributor
There was a problem hiding this comment.
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?
icewind1991
requested changes
Jun 6, 2024
Member
icewind1991
left a comment
There was a problem hiding this comment.
The frontend should be adjusted instead to handle these values instead
Merged
Merged
Merged
Member
|
Related front-end PR #43666 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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