You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extra usage widgets use wrong unit assumptions for usage API response #387
The ExtraUsageRemaining and ExtraUsageUtilization widgets make incorrect unit assumptions about fields returned by the usage API, producing wrong displayed values for pay-as-you-go users.
Details
In src/widgets/ExtraUsageRemaining.ts:
The code assumes extraUsageLimit is in cents but extraUsageUsed is in dollars.
In practice, both fields are in cents. The current math subtracts a cents value from a dollars value, producing a wildly inflated "remaining" amount.
In src/widgets/ExtraUsageUtilization.ts:
The code multiplies extraUsageUtilization by 100, assuming it's a fraction (0–1).
In practice, extraUsageUtilization is already a percentage (0–100). Multiplying by 100 produces values that get clamped to 100% almost immediately.
Expected behavior
"Overage Left" should reflect the true remaining overage budget in dollars.
"Overage Utilization" should reflect the actual percentage reported by the API.
Fix
PR incoming that divides extraUsageUsed by 100 before subtracting, and removes the * 100 on extraUsageUtilization.
Activity