Bugfix: Why did the Hetzner dashboard show 7.4 TB used instead of 7....
Documentation for Sessions
🐛 Bugfix: Why did the Hetzner dashboard show 7.4 TB used instead of 7....
Date: 2026-03-30
Time: 18:33:41 UTC
Session: gspace1-290.12
Agent: angular
Confidence: 100%
Status: ✅ Documented
📋 Decision Context
Question:
Why did the Hetzner dashboard show 7.4 TB used instead of 7.4 GB for AX102?
Task: Not specified
🎯 Decision Made
Chosen:
Fixed formatBytes() in hetzner-servers.component.ts — units array was ['KB','MB','GB','TB'] missing the 'B' entry, shifting every label up by one order of magnitude
Options Considered:
- No alternatives documented
💭 Reasoning
The function divided by 1024 on each iteration (correct for binary units) but started the units array at 'KB' instead of 'B'. After 3 divisions (getting GiB), index was 3 which mapped to 'TB' instead of 'GB'. The percentage was correct because it was calculated from the raw bytes — only the display labels were wrong. Fix: prepend 'B' to the units array. The early-return for n<1024 already handled the bytes case, so the loop started correctly after the fix.
📁 Files Involved
apps/gograb-dev/src/app/pages/infrastructure/hetzner-servers/hetzner-servers.component.ts
🔗 Related
- Decision ID:
dev_1774895621344_ydtq016 - Session: 290
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation