Skip to content

chore: update byte units on frontend#4444

Merged
NathanFlurry merged 1 commit intomainfrom
03-17-chore_update_byte_units_on_frontend
Apr 5, 2026
Merged

chore: update byte units on frontend#4444
NathanFlurry merged 1 commit intomainfrom
03-17-chore_update_byte_units_on_frontend

Conversation

@MasterPtato
Copy link
Copy Markdown
Contributor

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4444 March 17, 2026 19:38 Destroyed
@railway-app
Copy link
Copy Markdown

railway-app bot commented Mar 17, 2026

🚅 Deployed to the rivet-pr-4444 environment in rivet-frontend

Service Status Web Updated (UTC)
ladle ❌ Build Failed (View Logs) Web Apr 5, 2026 at 11:13 am
frontend-cloud 🕒 Building (View Logs) Web Apr 5, 2026 at 11:12 am
frontend-inspector 🕒 Building (View Logs) Web Apr 5, 2026 at 11:12 am
website ❌ Build Failed (View Logs) Web Mar 17, 2026 at 7:41 pm
mcp-hub ✅ Success (View Logs) Web Mar 17, 2026 at 7:39 pm

@claude
Copy link
Copy Markdown

claude bot commented Mar 17, 2026

PR Review: chore: update byte units on frontend

This PR updates byte unit labels throughout the billing frontend from decimal (KB/MB/GB/TB) to binary (KiB/MiB/GiB/TiB) IEC units, and switches the billing.ts threshold math from hand-rolled decimal constants to the bigBytes utility.

Behavioral change (not just a label fix)

The old code used decimal constants:

const KB = 1_000n
const GB = 1_000_000_000n
const TB = 1_000_000_000_000n

The new code uses binary math via bigBytes (confirmed: uses 1024-based multipliers):

bigBytes.KiB(4n) = 4096n          // was 4000n (+2.4%)
bigBytes.GiB(5n) = 5,368,709,120n // was 5,000,000,000n (+7.4%)
bigBytes.TiB(1n) = ~1.1T           // was 1,000,000,000,000n (+9.9%)

This changes the numeric thresholds used for billing calculations (free/pro/team plan allowances), not just the display labels. Please confirm the backend enforces limits using the same binary convention — if the backend uses 5 * 10^9 bytes for "5 GiB" storage, the frontend will show users as within quota when they are actually slightly over.

usage-card.tsx display change

The formatMetricValue function now divides by 1024-based divisors. A value previously shown as 1 GB will display as 0.93 GiB. This is the correct IEC representation, but it is a visible UX change worth a quick sanity check.

Everything else looks good

  • The bigBytes utility already existed and is correctly designed for this use case — removing the inline KB/GB/TB constants in favor of it is an improvement.
  • The comment block in billing.ts is consistently updated.
  • The metrics/constants.ts comment fix (4KB4KiB) is correct; the code already used bytes.KiB(4) so only the comment was wrong.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 17, 2026

More templates

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/cloudflare-workers@4444

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/framework-base@4444

@rivetkit/next-js

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/next-js@4444

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/react@4444

rivetkit

pnpm add https://pkg.pr.new/rivet-dev/rivet/rivetkit@4444

@rivetkit/sql-loader

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sql-loader@4444

@rivetkit/sqlite-vfs

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sqlite-vfs@4444

@rivetkit/traces

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/traces@4444

@rivetkit/workflow-engine

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/workflow-engine@4444

@rivetkit/virtual-websocket

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/virtual-websocket@4444

@rivetkit/engine-runner

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner@4444

@rivetkit/engine-runner-protocol

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner-protocol@4444

commit: 3aae0b5

@MasterPtato MasterPtato force-pushed the 03-17-chore_update_byte_units_on_frontend branch from f1b6d0a to d4011f0 Compare March 17, 2026 20:38
@MasterPtato MasterPtato force-pushed the 03-17-fix_runner_alloc_idx_logic_api_auth_for_actor_get branch from 5b2bead to cfc4fad Compare March 17, 2026 20:38
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4444 March 17, 2026 20:38 Destroyed
@MasterPtato MasterPtato force-pushed the 03-17-chore_update_byte_units_on_frontend branch from d4011f0 to 3b845cb Compare March 18, 2026 22:12
@MasterPtato MasterPtato force-pushed the 03-17-fix_runner_alloc_idx_logic_api_auth_for_actor_get branch from cfc4fad to 65280b5 Compare March 18, 2026 22:12
@MasterPtato MasterPtato force-pushed the 03-17-fix_runner_alloc_idx_logic_api_auth_for_actor_get branch from 65280b5 to 84dbf32 Compare March 21, 2026 01:55
@MasterPtato MasterPtato force-pushed the 03-17-chore_update_byte_units_on_frontend branch from 3b845cb to 1028b2c Compare March 21, 2026 01:55
@MasterPtato MasterPtato mentioned this pull request Mar 21, 2026
11 tasks
@MasterPtato MasterPtato force-pushed the 03-17-fix_runner_alloc_idx_logic_api_auth_for_actor_get branch from 84dbf32 to 90c2e97 Compare March 24, 2026 00:30
@MasterPtato MasterPtato force-pushed the 03-17-chore_update_byte_units_on_frontend branch from 1028b2c to 88d15c3 Compare March 24, 2026 00:30
@MasterPtato MasterPtato mentioned this pull request Mar 24, 2026
11 tasks
@MasterPtato MasterPtato force-pushed the 03-17-chore_update_byte_units_on_frontend branch from 88d15c3 to ede07de Compare March 24, 2026 00:36
@MasterPtato MasterPtato force-pushed the 03-17-fix_runner_alloc_idx_logic_api_auth_for_actor_get branch from 90c2e97 to ebdaa13 Compare March 24, 2026 00:36
@MasterPtato MasterPtato force-pushed the 03-17-chore_update_byte_units_on_frontend branch from ede07de to e9536ed Compare March 25, 2026 00:05
@MasterPtato MasterPtato force-pushed the 03-17-fix_runner_alloc_idx_logic_api_auth_for_actor_get branch 2 times, most recently from 63b3a1f to 73107a6 Compare March 26, 2026 01:18
@MasterPtato MasterPtato force-pushed the 03-17-chore_update_byte_units_on_frontend branch from e9536ed to cf68e1c Compare March 26, 2026 01:18
This was referenced Mar 28, 2026
@MasterPtato MasterPtato force-pushed the 03-17-chore_update_byte_units_on_frontend branch from 1cb5f34 to 34988dd Compare March 30, 2026 19:40
@MasterPtato MasterPtato force-pushed the 03-17-fix_runner_alloc_idx_logic_api_auth_for_actor_get branch from 791a38d to d5c2eee Compare March 31, 2026 01:40
@MasterPtato MasterPtato force-pushed the 03-17-chore_update_byte_units_on_frontend branch from 34988dd to 388ad2e Compare March 31, 2026 01:40
@MasterPtato MasterPtato mentioned this pull request Mar 31, 2026
11 tasks
@MasterPtato MasterPtato force-pushed the 03-17-fix_runner_alloc_idx_logic_api_auth_for_actor_get branch from d5c2eee to 5572d7e Compare March 31, 2026 22:24
@MasterPtato MasterPtato force-pushed the 03-17-chore_update_byte_units_on_frontend branch from 388ad2e to b1b526d Compare March 31, 2026 22:24
@MasterPtato MasterPtato mentioned this pull request Mar 31, 2026
11 tasks
@MasterPtato MasterPtato force-pushed the 03-17-chore_update_byte_units_on_frontend branch from b1b526d to 6ab46b0 Compare April 1, 2026 02:11
@MasterPtato MasterPtato force-pushed the 03-17-fix_runner_alloc_idx_logic_api_auth_for_actor_get branch 2 times, most recently from 98fbf07 to fecf384 Compare April 2, 2026 02:47
@MasterPtato MasterPtato force-pushed the 03-17-chore_update_byte_units_on_frontend branch from 6ab46b0 to a7a6cca Compare April 2, 2026 02:47
@MasterPtato MasterPtato force-pushed the 03-17-chore_update_byte_units_on_frontend branch from a7a6cca to 3aae0b5 Compare April 3, 2026 01:24
@MasterPtato MasterPtato force-pushed the 03-17-fix_runner_alloc_idx_logic_api_auth_for_actor_get branch from fecf384 to 0277ea1 Compare April 3, 2026 01:24
@NathanFlurry NathanFlurry mentioned this pull request Apr 4, 2026
11 tasks
Copy link
Copy Markdown
Member

NathanFlurry commented Apr 5, 2026

Merge activity

  • Apr 5, 11:11 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 5, 11:13 AM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 5, 11:13 AM UTC: @NathanFlurry merged this pull request with Graphite.

@NathanFlurry NathanFlurry changed the base branch from 03-17-fix_runner_alloc_idx_logic_api_auth_for_actor_get to graphite-base/4444 April 5, 2026 11:11
@NathanFlurry NathanFlurry changed the base branch from graphite-base/4444 to main April 5, 2026 11:11
@NathanFlurry NathanFlurry force-pushed the 03-17-chore_update_byte_units_on_frontend branch from 3aae0b5 to 98387ac Compare April 5, 2026 11:12
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4444 April 5, 2026 11:12 Destroyed
@NathanFlurry NathanFlurry merged commit 0ed764e into main Apr 5, 2026
10 of 18 checks passed
@NathanFlurry NathanFlurry deleted the 03-17-chore_update_byte_units_on_frontend branch April 5, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants