Repository navigation
fix(mobile): subscription widget no longer expires on a window that already reset - #22993
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.vp run check:changed: format, lint, knip, affected typechecks, and focused tests passed.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 scriptapps/mobile/scripts/seed-widget-fixture-22973.mts(apply <row> --anchor <iso>/revert). It drives the real build →publishSubscriptionUsage.android.ts→widget.updateSnapshotpath. Before swaps insubscriptionUsageSnapshot.tsfrom8d3b061121; nothing else differs. Fixture matrix: matrix.md.Environment (every capture): EAS cloud Android emulator
sdk_gphone64_x86_64, Android 15 (API 35), 720×1600, density 300 (from EAS docs;wm densitynot 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
d05935e9f9, no rebase, no force-push); the seed script was added in21250b531fand its lint fixed in0293255099.vp test run src/widgets/subscriptionUsageSnapshot.test.tspasses 14/14 atd05935e9f9and at0293255099.vp fmt --checkandvp lintare clean on all three changed files at head.Lint,Check). The status doesn't say which head they ran on; the earlier push21250b531ffailed lint, and lint and format are clean locally at0293255099.🤖 Generated with Claude Code