Report what an organization is storing

FeatureBillingService
Shipped
August 9, 2026 at 4:41 AM UTC
Author
Kamo
Commit
b6e9460

The account stats tab has always said "No usage data available for this period", for every organization, because getCurrentUsage() in kamo-internal is a stub returning zero meters and nothing behind it ever aggregated storage. Serves three distinct figures per storage area, plus a total: - what the organization holds right now, which falls when files are deleted - what it has added over its lifetime, which does not - what moved during the current billing period Removal is derived — no storage table timestamps a deactivation, since EmbRecordState.DATE_UPDATED is insertable=false and never refreshes — as opening + added - current against the period's opening snapshot. With no opening snapshot it falls back to trash timestamps and reports itself as a floor rather than presenting a guess as a measurement. Lifetime is exact where removed rows survive and accumulates from snapshots where they do not; both say which they are, so the UI can too. BillingPeriodResolver prefers a live subscription's period and falls back to the calendar month in the org's timezone. That fallback is the whole feature in production: every subscription there carries NULL current_period_start and current_period_end, so without it the period figures would be empty for every organization that exists — the same class of bug as the stub it replaces. StorageSnapshotSweep writes the daily position each org's history depends on, catching up to 14 missed days and seeding a first snapshot from the queryable lifetime so tracking does not restart at zero. The platform endpoint reports billed against physically stored bytes. Customers are billed per record; img_dats holds one copy per hash however many orgs have that file, and thumbnails and conversions cost bytes nobody is billed for. Both gaps are Kamo's economics, so they sit behind @PlatformAdminOnly. 21 new tests, 113 total, all passing.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing