Repository navigation
fix(mobile): usage widget never gives two accounts the same name - #43683
juliusmarminge merged 3 commits into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…unt-label-collision
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EvidenceOn a Pixel 9 emulator (Android API 36), configured two synthetic CLI Proxy hubs with pooled names
Synthetic hub driver · RPC seed script Both final screenshots were visually inspected and pixel-identical to follow-up captures. Not shown:
|


Problem
When a pooled usage limit has accounts named
codex,codex2,codex, the Android usage widget labels two of themcodex2instead ofcodex3.widgetAccounts(apps/mobile/src/widgets/subscriptionUsageSnapshot.ts) appended a count to duplicate names without checking that another account already had that name.CLI Proxy accounts without an email are named after their auth file, so
codex.json+codex2.jsonon one hub andcodex.jsonon another hit this.SubscriptionUsage.android.tsxuses the name as label and Reactkey.Change
All names are reserved first; the first account with a name keeps it, and a later duplicate takes the next free
${base}${n}. No account is given another account's name:codex,codex,codex2becomescodex,codex3,codex2.Scope
Small fix for an obvious bug; no issue needed. iOS has no per-account segments; web and
client-runtimehave no copy of this code. Gap keys (gap-${name}) can still meet a segment key for an account literally namedgap-<name>; that is on main already and left out.Verification
An AI agent ran each check below.
Setup: Android 16 emulator (Pixel 10), light theme, landscape home screen (wide enough for names); isolated dev server, no seeded data, two CLI Proxy sources on a local stub (
codex.json+codex2.json, andcodex.json); one dev client running each commit's JavaScript.Steps: relaunch T3 Code Dev → open Usage → Home → rotate to landscape → read the Subscription usage widget.
8c6a4a57(before)a3f9686e(after)Two different accounts are both labelled codex2 (50% and 30%)
Every account has its own label: codex, codex2, codex3
Regression test, checks and builder output
it.eachcases insubscriptionUsageSnapshot.test.ts(["AB","AB2","AB"]and["AB","AB","AB2"]). On base both fail:expected [ 'AB', 'AB2', 'AB2' ] to strictly equal [ 'AB', 'AB2', 'AB3' ]and… [ 'AB', 'AB3', 'AB2' ]. On head the file passes 12/12 in 3 of 3 runs.vp run check:changed: exit 0 (format, lint, knip, typecheck, test, React Compiler), no warnings.buildSubscriptionUsageSnapshoton the same two hubs, both reset orders:Links: commits above, regression test, stub, steps, builder harness, base and head observations. No recordings: nothing moves.
Not shown:
Generated with Claude Opus 5.5 in T3 Code Nightly