Skip to content

fix(mobile): subscription widget no longer expires on a window that already reset - #22993

Merged
juliusmarminge merged 7 commits into
mainfrom
fix/issue-22973
Nov 11, 2026
Merged

juliusmarminge merged 7 commits into
mainfrom
fix/issue-22973

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Problem

A freshly observed subscription snapshot can include a session reset timestamp that has already passed. The widget treated that timestamp as the whole provider’s expiry, so publishing the iOS timeline cleared every quota row, including a valid weekly row. This addresses the source reproduction in #22973; the phone’s actual provider timestamps have not been collected.

Change

Only reset timestamps after their own account observation time now bound expiry. The 15-minute freshness cap and earliest future reset still expire the provider together. Past resets display “Reset” and retain the provider’s reported percentage. Both iOS and Android use this snapshot builder.

Scope and approval

Fixes #22973
GitCafe: https://git.cafe/pingdotgg/t3code/issues/22973
Triaged bug via the automated issue flow.

Verification

Synthetic before/after, fixed UTC times: observed October 21 at 16:45; session 0% used, reset 16:30; weekly 30% used, reset October 28. Before: expiry 16:30 and the 16:45 timeline entry says “Open T3 to refresh” with no rows. After: session 100% remaining and weekly 70% remaining at 16:45, then both rows expire at 17:00. Changing only the session reset to 17:30 produces the same 17:00 deadline.

Validation:

  • Regression baseline: 3 failed, 7 passed. The pooled-account follow-up regression also failed before correction.
  • vp test run apps/mobile/src/widgets/subscriptionUsageSnapshot.test.ts: 14 passed, including iOS/Android shared snapshot inputs, past/equal-observation resets, 15-minute expiry, an earlier future reset, and pooled accounts with different observation times.
  • Targeted mobile lint and typecheck passed.
  • vp run check:changed: format, lint, knip, affected typechecks, and focused tests passed.
  • Final independent code reviews: GPT-6.1-Sol/Codex MERGE; Claude Opus 5.5/Claude Agent MERGE.
  • Final evidence audit: Claude Opus 5.5/Claude Agent SUFFICIENT for the synthetic expiry bug; all 14 tests passed independently.
  • cannot-verify ios live (Linux VM; no simulator or native build attempted).
  • User documentation remains accurate and was not changed.

Model/harness: GPT-6.1-Sol through the Codex harness in T3 Code; independent code and evidence review delegated to GPT-6.1-Sol/Codex and Claude Opus 5.5/Claude Agent.

Evidence

Real Android app, home-screen widget on the launcher. Before = 8d3b061121 (merge-base on main); after = 0293255099 (head, 02932550995a8d55c28a336c343c56a557721c43). Both sides were seeded with the same fixture by the committed script apps/mobile/scripts/seed-widget-fixture-22973.mts (apply <row> --anchor <iso> / revert). It drives the real build → publishSubscriptionUsage.android.ts → widget.updateSnapshot path. Before swaps in subscriptionUsageSnapshot.ts from 8d3b061121; nothing else differs. Fixture matrix: matrix.md.

Row Before (main) After (head)
F1 not yet reset both windows "Next reset" identical
F2 already reset (https://git.cafe/pingdotgg/t3code/issues/22973) "Open T3 to refresh" immediately Weekly "Next reset …", 5 hours "Reset …"
F3 all reset expired immediately both windows "Reset …"
F8 long window label, >2 windows expired immediately long red label on one line, Weekly 50%, "1 more in T3"
F7a pooled, newer account reset expired immediately 5 hours "Reset …", "As of" oldest reading
Row Theme Before After Diff0 DiffT
F1 Window not yet reset light F1-light-before F1-light-after F1-light-diff0 F1-light-diffT
F1 Window not yet reset dark F1-dark-before F1-dark-after F1-dark-diff0 F1-dark-diffT
F2 Window already reset (https://git.cafe/pingdotgg/t3code/issues/22973) light F2-light-before F2-light-after F2-light-diff0 F2-light-diffT
F2 Window already reset (https://git.cafe/pingdotgg/t3code/issues/22973) dark F2-dark-before F2-dark-after F2-dark-diff0 F2-dark-diffT
F3 All windows reset light F3-light-before F3-light-after F3-light-diff0 F3-light-diffT
F3 All windows reset dark F3-dark-before F3-dark-after F3-dark-diff0 F3-dark-diffT
F8 Long window labels, >2 windows light F8-light-before F8-light-after F8-light-diff0 F8-light-diffT
F8 Long window labels, >2 windows dark F8-dark-before F8-dark-after F8-dark-diff0 F8-dark-diffT
F7a Pooled, newer account reset dark F7a-dark-before F7a-dark-after F7a-dark-diff0 F7a-dark-diffT

Environment (every capture): EAS cloud Android emulator sdk_gphone64_x86_64, Android 15 (API 35), 720×1600, density 300 (from EAS docs; wm density not readable, no adb shell), font scale 1.0, Pixel Launcher, device theme light/dark as labelled, app appearance default; EAS preview:dev APK build 67d8faf8 (fingerprint matches head), JS from Metro. The clock could not be frozen (agent-device has no adb shell). Each pair shares one anchor (device time rounded down to the minute), with fixtures relative to that anchor and the after shot taken within 15 min of it.

What else changed: the status bar clock in every pair (the two shots were taken in different minutes). F3-dark, F7a-dark and F8-dark after: dock and search bar sit lower because the screenshot caught the launcher's go-home animation; this is not a widget change. F3-light: a small diff near the gesture handle, from shots taken 21 min apart. Otherwise none: the fuzzed diff outside the status bar is confined to the widget, or is 0 px for F1.

Verification log
  • Main merged into the branch by a merge commit (d05935e9f9, no rebase, no force-push); the seed script was added in 21250b531f and its lint fixed in 0293255099.
  • Tests: vp test run src/widgets/subscriptionUsageSnapshot.test.ts passes 14/14 at d05935e9f9 and at 0293255099. vp fmt --check and vp lint are clean on all three changed files at head.
  • Proof audit pass 1 (Claude Opus 5.5): fixture matrix F1–F9 plus light/dark. Long provider names can't occur, because the widget hard-codes "Codex"/"Claude", so F8 covers long window labels.
  • Proof audit pass 2 (Claude Opus 5.5): SUFFICIENT for not-yet-reset, already-reset, all-reset and long labels, light and dark, on Android. SHAs were checked against the capture log. The auditor rebuilt F2 from the committed script in a scratch worktree: before expired at 11:09Z ("Open T3 to refresh"); after fresh until 11:39Z with "Next reset Oct 29, 11:24 AM" and "Reset Oct 22, 11:09 AM", matching the screenshot text for text.
  • Caveats from audit 2:
    • F3-light-before was shot 28 min after its anchor, so it doesn't separate the two versions; F3-dark is the F3 proof.
    • F8-light-before has no capture-log line.
    • F8's past window is hidden by the 2-window limit, so a long label next to "Reset" is covered only by unit tests.
    • The matrix wrongly predicted a "2 accounts · pooled" line for F7a; Android shows the detail line only when no windows are shown.
  • CI at the time of writing: 28 successful, 2 failing (Lint, Check). The status doesn't say which head they ran on; the earlier push 21250b531f failed lint, and lint and format are clean locally at 0293255099.
  • Unverified rows:
    • iOS, all rows: the widget is native WidgetKit via expo-widgets, the repo has no static fixture mode, and this Linux VM has no simulator.
    • Android: F7a light and F9 (an invalid capture, then out of time); F4, F5, F6 and F7b not attempted (budget).
  • Model/harness: Claude Opus 5.5 through the Claude Agent harness in T3 Code (evidence lead, proof auditor ×2, evidence capturer).

🤖 Generated with Claude Code

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fix PR opened by an issue lead; enters the PR loop pr:gate-failed A land gate failed size:S 10-29 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: iOS Subscription usage widget stays empty after opening the app, while Usage → Limits shows quotas

2 participants