Repository navigation
Proper separation of quota values in APIs - #27895
Conversation
e3991d8 to
74a59f2
Compare
From 9.1.5 onwards, LDAP can accept "none" and "default" as quota values. Those exact values will be written as quota for the user. There is no further action over those values from the LDAP app. |
|
@jvillafanez thanks for confirming, that's exactly what I thought. |
|
Trying to debug this, seems we got a rabbit hole bug... looks like another file cache bug got revealed through this... |
|
ok got it. seems some tests or the mock might be returning "null" as quota which is misinterpreted as zero. Fix will follow, also for the backport PR |
|
added null check when reading from config |
|
ok, a few more to go... But first: 🍔 |
|
fixed versions too by bringing back the old code there. I wonder if I should maybe change the code for trashbin and versions to use OC_Util::getUserQuota instead |
|
Just retested and there is one remaining issue: when setting the quota to "default" in the users page, it sometimes switches to the actual default value instead of staying "default". |
|
AHA, the column first contains NULL which is not properly mapped to "default". Only once I set it to "default" explicitly it becomes "default". |
|
interpretation of quota is up to a higher layer |
|
Set default quota to 5 GB
|
Interestingly the even users who had "default" explicitly set are getting NULL in the accounts table. Doesn't hurt. Please re-review |
|
@individual-it weird thing that the quota UI tests fail on Firefox but not Chrome ? |
There was a problem hiding this comment.
What about using Util::getUserQuota(...) and have all this calculations in one place?
There was a problem hiding this comment.
at first I thought it wouldn't work because getUserQuota doesn't return null but would return SPACE_UNLIMITED. But I could just use that value for the below check.
I'll have a try.
|
stable9.1: #27896 (also updated) |
|
Code looks fine 👍 |
User::getQuota() and User::setQuota() are now reading the exact value as set in the database instead of interpreting it. This is how it used to behave. Util::getUserQuota() is the method that interprets the quota for example by replacing a default value with the default quota value from the app config.
|
shake that CI |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |

Description
User::getQuota() and User::setQuota() are now reading the exact value as
set in the database instead of interpreting it. This is how it used to
behave.
Util::getUserQuota() is the method that interprets the quota for example
by replacing a default value with the default quota value from the app
config.
Basically the users page must show exactly what's stored in the DB and not interpret the values.
@DeepDiver1975 also fixes misinterpretation of default which should be "default", not "none" in account table.
Related Issue
Fixes #27803
Motivation and Context
Bring back correct default quota behavior.
How Has This Been Tested?
See steps in ticket.
Set one user to "Unlimited" in users page.
Set one user to "Default" in users page.
Set default quota to "1 GB".
Refresh page.
Before fix: quota appears as "1 GB" instead of selected values.
After fix: quota appears as whatever was selected before which is what is stored in DB.
Screenshots (if appropriate):
Types of changes
Checklist:
Some unit tests may fail, we'll see.
@jvillafanez can you check whether this could influence LDAP default quota handling ?
@davitol