Repository navigation
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.
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.
Main issue: the default value was not converted to the new frontend unit.
Issues
Critical: default
10_000_000is now interpreted as KloadQuota()setstokenLimit: 10_000_000whenquota.token_limitis null.buildPayload()multiplies by1000, saving that default sends10_000_000_000tokens, not10_000_000.10_000_000raw tokens, the form default should be10_000.Build-side conversion is not validated or rounded
quotaSettingsForm.tokenLimit * 1000can produce:NaNif the input is invalid,Infinityfor very large values.Math.round(...)and validate.Precision loss on load/save round trip
Math.round(quota.token_limit / 1000)loses precision.10_000_500becomes10_001K, then saves as10_001_000.Unit conversion is duplicated and uses magic numbers
1000conversion appears in two places.tokenLimitK.Possible string-to-number coercion
tokenLimit * 1000silently coerces it.0; invalid input becomesNaN.Suggested changes
If exact backend values must be preserved, avoid
Math.roundon load and allow decimal K, e.g.quota.token_limit / TOKENS_PER_K, or store the original raw value separately.