Fix zero usage percentages in org plan usage#1783
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRefactors organization usage logic: storage is fetched in bytes then converted to GB; adds Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/pages/settings/organization/Usage.vue`:
- Around line 144-150: The fallback inputs to maybeDeriveMissingUsagePercents
are passing totalBandwidthBytes and totalStorageBytes as raw bytes while
currentPlan.bandwidth and currentPlan.storage are interpreted as GB elsewhere;
convert the byte totals to GB before calling maybeDeriveMissingUsagePercents
(e.g., totalBandwidthGB = totalBandwidthBytes / (1024**3) and totalStorageGB =
totalStorageBytes / (1024**3)) so the derived percentages use matching units;
update both call sites that pass totalBandwidthBytes/totalStorageBytes (the
detailPlanUsage call and the similar call around the 253–255 region) to pass the
GB-converted values.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 70436eae-4727-44a4-a156-1fdc381bcbf4
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (1)
src/pages/settings/organization/Usage.vue
a69a0d5 to
9e8b013
Compare
|



Summary
get_plan_usage_percent_detailedpayload incorrectly returns all-zero percentages while usage exists.Test plan
bun lint src/pages/settings/organization/Usage.vue.0%for every category.Screenshots
Checklist
bun run lint:backend && bun run lint.Summary by CodeRabbit