Repository navigation
feat(billing): switch monthly subscribers to yearly with the exact charge shown - #23764
Merged
Merged
Conversation
…exact charge shown Monthly plans churn 18.8%/month against 1.7% for annual, and monthly payers were never offered the cheaper yearly price of their own plan ($269.91 against 12 x $29.99). - GET /v1/payments/yearly-switch: whether this reader can switch, the saving, and with preview=true Stripe's invoice preview (charge today, renewal date, proration date). Only an active, renewing, undiscounted Plus or Unlimited monthly subscription without a trial, past_due state, scheduled cancel or schedule qualifies. - POST /v1/payments/upgrade-subscription with switch_now: the same-plan monthly to yearly change is charged now with proration (error_if_incomplete) at the previewed proration date instead of being scheduled for the period end. It refuses every state the offer hides (no #23298 trial switch, no promotion code or carried discount); a declined card returns 402 and leaves the monthly subscription and the stored plan untouched (#23301). - App: a "Switch to Yearly · Save $89.97 a year" row in Plans & Billing, one quiet dismissible Home row past the first paid month (at most every 30 days), and a confirm sheet with the preview. Unsampled events Subscription Yearly Switch Shown/Opened/Confirmed/Succeeded/Failed/Dismissed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e-line decline message Co-Authored-By: Claude Opus 5.5 <[email protected]>
…itch Co-Authored-By: Claude Opus 5.5 <[email protected]>
… months away Co-Authored-By: Claude Opus 5.5 <[email protected]>
…/after on the simulator Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
…ams (pyright) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…er Home Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-switch # Conflicts: # app/lib/l10n/app_ar.arb # app/lib/l10n/app_be.arb # app/lib/l10n/app_bg.arb # app/lib/l10n/app_bn.arb # app/lib/l10n/app_bs.arb # app/lib/l10n/app_ca.arb # app/lib/l10n/app_cs.arb # app/lib/l10n/app_da.arb # app/lib/l10n/app_de.arb # app/lib/l10n/app_el.arb # app/lib/l10n/app_en.arb # app/lib/l10n/app_es.arb # app/lib/l10n/app_et.arb # app/lib/l10n/app_fa.arb # app/lib/l10n/app_fi.arb # app/lib/l10n/app_fr.arb # app/lib/l10n/app_he.arb # app/lib/l10n/app_hi.arb # app/lib/l10n/app_hr.arb # app/lib/l10n/app_hu.arb # app/lib/l10n/app_id.arb # app/lib/l10n/app_it.arb # app/lib/l10n/app_ja.arb # app/lib/l10n/app_kn.arb # app/lib/l10n/app_ko.arb # app/lib/l10n/app_localizations.dart # app/lib/l10n/app_localizations_ar.dart # app/lib/l10n/app_localizations_be.dart # app/lib/l10n/app_localizations_bg.dart # app/lib/l10n/app_localizations_bn.dart # app/lib/l10n/app_localizations_bs.dart # app/lib/l10n/app_localizations_ca.dart # app/lib/l10n/app_localizations_cs.dart # app/lib/l10n/app_localizations_da.dart # app/lib/l10n/app_localizations_de.dart # app/lib/l10n/app_localizations_el.dart # app/lib/l10n/app_localizations_en.dart # app/lib/l10n/app_localizations_es.dart # app/lib/l10n/app_localizations_et.dart # app/lib/l10n/app_localizations_fa.dart # app/lib/l10n/app_localizations_fi.dart # app/lib/l10n/app_localizations_fr.dart # app/lib/l10n/app_localizations_he.dart # app/lib/l10n/app_localizations_hi.dart # app/lib/l10n/app_localizations_hr.dart # app/lib/l10n/app_localizations_hu.dart # app/lib/l10n/app_localizations_id.dart # app/lib/l10n/app_localizations_it.dart # app/lib/l10n/app_localizations_ja.dart # app/lib/l10n/app_localizations_kn.dart # app/lib/l10n/app_localizations_ko.dart # app/lib/l10n/app_localizations_lt.dart # app/lib/l10n/app_localizations_lv.dart # app/lib/l10n/app_localizations_mk.dart # app/lib/l10n/app_localizations_mr.dart # app/lib/l10n/app_localizations_ms.dart # app/lib/l10n/app_localizations_nl.dart # app/lib/l10n/app_localizations_no.dart # app/lib/l10n/app_localizations_pl.dart # app/lib/l10n/app_localizations_pt.dart # app/lib/l10n/app_localizations_ro.dart # app/lib/l10n/app_localizations_ru.dart # app/lib/l10n/app_localizations_sk.dart # app/lib/l10n/app_localizations_sl.dart # app/lib/l10n/app_localizations_sr.dart # app/lib/l10n/app_localizations_sv.dart # app/lib/l10n/app_localizations_ta.dart # app/lib/l10n/app_localizations_te.dart # app/lib/l10n/app_localizations_th.dart # app/lib/l10n/app_localizations_tl.dart # app/lib/l10n/app_localizations_tr.dart # app/lib/l10n/app_localizations_uk.dart # app/lib/l10n/app_localizations_ur.dart # app/lib/l10n/app_localizations_vi.dart # app/lib/l10n/app_localizations_zh.dart # app/lib/l10n/app_lt.arb # app/lib/l10n/app_lv.arb # app/lib/l10n/app_mk.arb # app/lib/l10n/app_mr.arb # app/lib/l10n/app_ms.arb # app/lib/l10n/app_nl.arb # app/lib/l10n/app_no.arb # app/lib/l10n/app_pl.arb # app/lib/l10n/app_pt.arb # app/lib/l10n/app_ro.arb # app/lib/l10n/app_ru.arb # app/lib/l10n/app_sk.arb # app/lib/l10n/app_sl.arb # app/lib/l10n/app_sr.arb # app/lib/l10n/app_sv.arb # app/lib/l10n/app_ta.arb # app/lib/l10n/app_te.arb # app/lib/l10n/app_th.arb # app/lib/l10n/app_tl.arb # app/lib/l10n/app_tr.arb # app/lib/l10n/app_uk.arb # app/lib/l10n/app_ur.arb # app/lib/l10n/app_vi.arb # app/lib/l10n/app_zh.arb
…previewed amount PR #23774 made Omi Pro the only plan sold, so the offer is Omi Pro monthly ($29.99) to Omi Pro yearly ($269.91), USD only. Retired plans are not offered a new yearly term. - The switch requires the preview's proration_date and expected_amount_due, re-runs Invoice.create_preview at that date and refuses (409) unless Stripe would charge exactly that. - Subscription.modify carries an idempotency key bound to that preview, so a retried or doubled request replays Stripe's first result. - A customer-level coupon on the preview invoice refuses the offer, like a subscription discount. - App: a retry after any failure re-previews first and shows a moved amount before charging; a lost response is settled by reading Stripe again instead of claiming the reader is still monthly; the Home saving rounds down ($89), never up.
…age provider or env Home and Plans & Billing hosts that render without UsageProvider (tests, previews) or before Env is ready showed a provider error or a LateInitializationError. The offer is optional: no provider or an unreadable lookup now hides it.
A paused subscription voids the switch invoice and an invoiced (send_invoice) one is not charged now, so neither can take the immediate switch. The router's switch_now guard and charge arguments live in utils.yearly_switch (upgrade_refusal, charge_params).
…$89.97) formatBillingPrice keeps the currency unambiguous and locale-stable, as the plan cards do since 1320b5a. The Home row now shows the exact saving instead of a rounded one.
…-switch # Conflicts: # app/lib/l10n/app_ar.arb # app/lib/l10n/app_be.arb # app/lib/l10n/app_bg.arb # app/lib/l10n/app_bn.arb # app/lib/l10n/app_bs.arb # app/lib/l10n/app_ca.arb # app/lib/l10n/app_cs.arb # app/lib/l10n/app_da.arb # app/lib/l10n/app_de.arb # app/lib/l10n/app_el.arb # app/lib/l10n/app_en.arb # app/lib/l10n/app_es.arb # app/lib/l10n/app_et.arb # app/lib/l10n/app_fa.arb # app/lib/l10n/app_fi.arb # app/lib/l10n/app_fr.arb # app/lib/l10n/app_he.arb # app/lib/l10n/app_hi.arb # app/lib/l10n/app_hr.arb # app/lib/l10n/app_hu.arb # app/lib/l10n/app_id.arb # app/lib/l10n/app_it.arb # app/lib/l10n/app_ja.arb # app/lib/l10n/app_kn.arb # app/lib/l10n/app_ko.arb # app/lib/l10n/app_localizations.dart # app/lib/l10n/app_localizations_ar.dart # app/lib/l10n/app_localizations_be.dart # app/lib/l10n/app_localizations_bg.dart # app/lib/l10n/app_localizations_bn.dart # app/lib/l10n/app_localizations_bs.dart # app/lib/l10n/app_localizations_ca.dart # app/lib/l10n/app_localizations_cs.dart # app/lib/l10n/app_localizations_da.dart # app/lib/l10n/app_localizations_de.dart # app/lib/l10n/app_localizations_el.dart # app/lib/l10n/app_localizations_en.dart # app/lib/l10n/app_localizations_es.dart # app/lib/l10n/app_localizations_et.dart # app/lib/l10n/app_localizations_fa.dart # app/lib/l10n/app_localizations_fi.dart # app/lib/l10n/app_localizations_fr.dart # app/lib/l10n/app_localizations_he.dart # app/lib/l10n/app_localizations_hi.dart # app/lib/l10n/app_localizations_hr.dart # app/lib/l10n/app_localizations_hu.dart # app/lib/l10n/app_localizations_id.dart # app/lib/l10n/app_localizations_it.dart # app/lib/l10n/app_localizations_ja.dart # app/lib/l10n/app_localizations_kn.dart # app/lib/l10n/app_localizations_ko.dart # app/lib/l10n/app_localizations_lt.dart # app/lib/l10n/app_localizations_lv.dart # app/lib/l10n/app_localizations_mk.dart # app/lib/l10n/app_localizations_mr.dart # app/lib/l10n/app_localizations_ms.dart # app/lib/l10n/app_localizations_nl.dart # app/lib/l10n/app_localizations_no.dart # app/lib/l10n/app_localizations_pl.dart # app/lib/l10n/app_localizations_pt.dart # app/lib/l10n/app_localizations_ro.dart # app/lib/l10n/app_localizations_ru.dart # app/lib/l10n/app_localizations_sk.dart # app/lib/l10n/app_localizations_sl.dart # app/lib/l10n/app_localizations_sr.dart # app/lib/l10n/app_localizations_sv.dart # app/lib/l10n/app_localizations_ta.dart # app/lib/l10n/app_localizations_te.dart # app/lib/l10n/app_localizations_th.dart # app/lib/l10n/app_localizations_tl.dart # app/lib/l10n/app_localizations_tr.dart # app/lib/l10n/app_localizations_uk.dart # app/lib/l10n/app_localizations_ur.dart # app/lib/l10n/app_localizations_vi.dart # app/lib/l10n/app_localizations_zh.dart # app/lib/l10n/app_lt.arb # app/lib/l10n/app_lv.arb # app/lib/l10n/app_mk.arb # app/lib/l10n/app_mr.arb # app/lib/l10n/app_ms.arb # app/lib/l10n/app_nl.arb # app/lib/l10n/app_no.arb # app/lib/l10n/app_pl.arb # app/lib/l10n/app_pt.arb # app/lib/l10n/app_ro.arb # app/lib/l10n/app_ru.arb # app/lib/l10n/app_sk.arb # app/lib/l10n/app_sl.arb # app/lib/l10n/app_sr.arb # app/lib/l10n/app_sv.arb # app/lib/l10n/app_ta.arb # app/lib/l10n/app_te.arb # app/lib/l10n/app_th.arb # app/lib/l10n/app_tl.arb # app/lib/l10n/app_tr.arb # app/lib/l10n/app_uk.arb # app/lib/l10n/app_ur.arb # app/lib/l10n/app_vi.arb # app/lib/l10n/app_zh.arb # app/lib/pages/conversations/conversations_page.dart
kodjima33
added a commit
that referenced
this pull request
Oct 29, 2026
…23762) > **Nik approved this ship on 2026-10-27.** Refreshed 2026-10-29 on main @ `d60cd2eab6` (includes #23921 "Processing paused" Upgrade and #23924 Daily Recaps hidden by default). ## Problem Free Omi owners are asked to pay at the wrong moment, or never. - **64% of free active owners (2,580 of 4,011) saw no paywall in the last 30 days.** 936 of them used their Omi on 3+ days. (MUX sessions analysis 2026-10-26, PostHog 302298.) - Only **51%** of people who had a first conversation ever see a paywall (7-day funnel, Oct 13-19 installs). - The cap prompt is legacy-Plus-only (`freemium_threshold_tracker.dart`). When a free owner runs out of the free allowance, their conversations lock silently (`backend/routers/sync.py`). Tapping a locked row opens Plan & Usage, which has no offer on it. - The sign-up trial placement is closed within 5s by 34-38% of people, before they have felt any value. ## Change The paywall now shows at the two moments a free owner has just felt the value: 1. **AHA (`aha_first_summary`)**: they read the summary of their own conversation for 3s or more, then go back. The offer slides up on Home and never interrupts the summary. 2. **CAP (`free_cap`)**: a conversation locked by the free allowance appears in their list (today the lock is silent). Rules: - Once per moment per account. - At most one paywall per 72h across every placement. Every paywall surface (trial, outline and web pages, plus `PlansSheet`) records when it appeared (`PaywallPacing`). A paced moment is not spent; it waits for the next one. - Only free (`basic`) readers who own an Omi: paired on this phone, or the conversation came from one. - Never for paying readers or App Review builds (subscription UI hidden). AHA needs a trial left. At CAP, readers with no trial left get the normal plans sheet. - Never stacked on a store-review sheet asked for in the same session. - It goes through `PromptQueue` (never over a recording, a call or a firmware update) and `PaywallRouter`, so the live `paywall-variant` arm (100% `trial`) still owns the design. No copy changes. - **No double prompt with "Processing paused" (#23921).** That Upgrade is a button the reader taps. It opens the plans sheet, which records `PaywallPacing`, so a CAP offer queued before, during or after it stays away for 72h. The paused card and a locked row also come from different states: `sync.py` never locks a conversation for `usage_budget_exhausted`. - Analytics: `aha_first_summary` and `free_cap` are new `source` values on `Paywall Opened`, `Paywall Variant Shown` and `Upgrade Plan Selected`. All three pass PostHog's keep rule (`paywall` / `upgrade`), so exposure is unsampled. Prices are unchanged and come from the backend catalog: Omi Pro US$29.99/month or US$269.91/year (live Stripe, read-only key, 2026-10-29). Nothing in this PR computes a price or charges; the trial page opens Stripe Checkout only after a tap, and only for a trial-eligible reader. ## Impact estimate **Free→paid (device owners) 32.4% → ~32.9% (range 32.7-33.1%) in the first month. Churn is unchanged.** (MODELED; baseline ACTUAL 2,428 of 7,486 observed owners, MUX baseline 2026-10-28.) Basis: ~700-1,100 offers a month × 6-9% trial start × 50% trial→paid ≈ 21-50 new payers on 7,486 owners (1 pt ≈ 75 payers). - AHA reach is measured: only **500 of 3,688 free never-paid owners (13.6%) opened a conversation in 30 days** (`Conversation List Item Clicked`, unsampled). - CAP reach is modeled at 450-900. At least 451 free owners tapped a locked row in 30 days. - Trial-start rate comes from Omi's own prompted placements (free-cap row 8-13%, Settings trial page 8.5-9.3%, sign-up 5.5-11.4%). Trial→paid is assumed. ## Evidence (iPhone 17 Pro simulator, iOS 26.2, local backend, live prices via the offline Stripe stub) BEFORE = `main` @ `d60cd2eab6`. AFTER = this branch @ `1d30d1a589` (the same app code as this head). Same seeded free, trial-eligible owner in both; the `trial` arm is forced as in prod (`OMI_PAYWALL_VARIANT=trial`). Scenarios: `~/mobile-ux-agent/pipeline/scenarios/{aha-trial-offer,free-cap,cap-after-upgrade}.sh`.  On main the second panel shows iOS's own rating ask: that run's read passed 5s, which is when the app asks for a store review. With a shorter read main shows plain Home. This PR never stacks the offer on a rating ask: the moment then waits for a later session.     Videos (this MacBook): `~/mobile-ux-agent/runs/2026-10-29/pr23762/after/{aha-trial-offer-light,free-cap-light,cap-after-upgrade-light,aha-trial-offer-dark,aha-review-collision-light}/demo.mp4`; main: `.../pr23762/before/{aha-trial-offer-light,free-cap-light}/demo.mp4`. Simulator results (`result.txt` of each run): | Check | main | this PR | |---|---|---| | Back from the first summary (read 3s+) | no paywall | **trial offer** (light and dark), live prices: 7 days free, then US$269.91/year | | Read a second summary | no paywall | no paywall (once per moment, 72h pacing) | | The free allowance locks a new conversation | silent locked row | **trial offer** about 1s later | | Relaunch with the locked row on top | no paywall | no paywall (once per moment) | | Reader opens the plans sheet (the one "Processing paused" Upgrade opens), closes it, then a conversation locks | n/a | **no second paywall** (72h pacing) | | Long read (9s): iOS shows its rating ask, then Back | rating ask | rating ask, **no trial offer stacked on it** | ## Tests - `flutter test test/widgets/value_moment_paywall_test.dart`: 16 passed. New: the real "Processing paused" Upgrade opener (`openHeldAudioPlans`) opens the plans sheet, then the cap offer stays away. It fails without the `PaywallPacing.markShown()` line in `PlansSheet`. - 27 neighbour files, 257 tests passed (Flutter 3.44.5): paywall router, trial/outline pages and navigation, plans sheet, storefront handoff and plans content, contextual plans fallback (#23921), locked preview, conversation detail (ux, status, summary retry, copy id), swipe delete, on-device free tier, app review prompt, Home daily recaps toggle (#23924) and navigation, usage provider paywall pin, paywall experiment, spine B1 home/conversations/conversation detail. - `dart analyze` on changed files: no new issues. Pre-push preflight passed. - Merges cleanly with #23764; the generated event registry stays current on the combined tree. Not verified: a real device with a paired Omi, real Stripe Checkout, and the live PostHog flag. On the simulator the arm comes from the debug override and the owner gate is met by the conversation's `source: omi`. UI-Evidence: see the images above (`.agent-artifacts/ui-evidence/mux-2026-10-26-aha-trial-offer/`). ## Product invariants affected none ## Failure class (fixes) Failure-Class: none
kodjima33
added a commit
that referenced
this pull request
Nov 5, 2026
## Problem
52 of 265 monthly churns (19.6%) were failed payments in the proposal's
30-day Stripe analysis. The app only exposes active/inactive
subscription state, while a failed Stripe renewal becomes Basic. Home
gives the reader no way to see or fix the failed payment.
## Change
Show the approved Home row below Home / Tasks and above Today: a red
dot, “Your card was declined”, “Update it to get Omi Pro back”, and a
black Update pill. At large accessibility text sizes the action moves
below the copy. It opens the existing Stripe-hosted customer billing
portal. Refresh the subscription on return so a paid invoice removes the
row.
The backend adds optional `payment_issue {status, plan}` only on
iOS/Android for a recoverable past_due/unpaid renewal with an open,
attempted invoice, `billing_reason=subscription_cycle` and money
remaining. Failed plan changes (`subscription_update`), new
subscriptions and missing billing reasons are excluded. Recovery reuses
the Stripe subscription already read by reconciliation, so it never
makes a second subscription lookup. Desktop/web do not read recovery
invoices. An expired stored billing period still checks Stripe for a
payable renewal. Chosen cancellations, ended trials, hidden billing UI
and non-Omi prices stay excluded. Entitlement handling and the
active/inactive enum stay unchanged. All locales include the new copy
through `scripts/l10n.py`.
## Impact estimate
Churn 10.5% → ~9.8% (modeled: recover ~40% of 52 monthly involuntary
churns)
Basis: **ACTUAL, proposal analysis**: 52 failed-payment churns out of
265 monthly churns. **MODELED**: 40% recovery, about 21
subscriptions/month. The 10.5% baseline and approximate 9.8% target are
the supplied proposal estimate; no new live metric query was run. Home
reach and actual recovery are unmeasured.
## Money review
Verdict: **no charge path**. Recovery reuses reconciliation's existing
subscription snapshot and only retrieves the latest invoice for a mobile
past_due/unpaid reader. Update creates the same customer-portal session
as Plans & Billing; card entry and payment happen on Stripe's page. No
charge, retry, cancel, price, coupon, entitlement or schedule change is
added. No PostHog flags or live state changed.
Reviewed against `~/mobile-ux-agent/runs/2026-10-29/money-review-p4.md`.
Simulator portal content and paid-state transitions use the offline
loopback Stripe stub, not live Stripe.
## Evidence

<details>
<summary>Portal, paid state, dark, largest text, locales and error
evidence</summary>










</details>
[Money
review](https://raw.githubusercontent.com/BasedHardware/omi/201a052ca38f7561f7fd5bcc947febca5d584326/.agent-artifacts/ui-evidence/mux-2026-10-29-card-declined/money-review.md)
[Verification
details](https://raw.githubusercontent.com/BasedHardware/omi/201a052ca38f7561f7fd5bcc947febca5d584326/.agent-artifacts/ui-evidence/mux-2026-10-29-card-declined/verification.txt)
| User action | Observed result |
| --- | --- |
| Same past_due payer on main | Basic, no recovery row |
| Same payer on this branch | One recovery row above Today with accurate
get Pro back copy |
| Failed upgrade: open attempted $255.27 subscription_update invoice |
Backend returns no payment_issue; real Home row absent |
| Update, return unpaid, twice | Portal opens; row remains both times |
| Third Update, paid invoice fixture, return | App refresh is the first
subscription read; Pro restored and row removed |
| Relaunch after paid | Row stays absent |
| Portal failures (current hermetic widget regression) | Error feedback
retains the row; failed and HTTP error pages emit no portal-opened event
|
| Money calls across three visits | 3 portal sessions; 0 charge or
subscription-change calls |
| Large text and locales | Recovery copy and Update fit; German,
Japanese and Arabic rendered |
Full native recordings, short MP4/GIF, raw stub requests and per-step
checks are under `~/mobile-ux-agent/runs/2026-10-29/p4/`. The revised
20.48-second native video is `round1/demo.mp4`; `round1/demo.gif` is its
animated preview. Raw requests, checks and visual inspection are under
`round1/`.
Evidence uses an iPhone 17 Pro simulator, the real Flutter app and local
backend, Firestore/Auth emulators and offline Stripe fixtures. BEFORE is
main `92bff3c2d5` at the start of this run; AFTER uses source
`4e7904d217` with the same past_due month-2 subscriber. The portal is an
explicit offline stub.
## At ship
Draft only. No rollout, release or flag change. Backend and app must
both ship to expose the row. New app + old backend shows no row; older
clients ignore the optional field. Three typed events are registered
with an executable consumer: `Subscription Payment Issue Shown`,
`Subscription Payment Issue Update Tapped`, and `Subscription Payment
Issue Portal Opened`. Their names match the `subscri` ingestion keep
rule. Shown deduplicates unchanged issue refreshes; portal-opened fires
after the native page finishes loading, excluding blank, failed and HTTP
error pages. No event claims payment recovery; use authoritative Stripe
invoices for that outcome. No ingestion rule or flag was changed.
## Tests
Review round 1: 578 backend tests and 16 app widget tests passed, one
file per process:
- Billing recovery decision: 44 passed, including renewal-only billing
reasons and missing/foreign reconciliation snapshots. The four
non-renewal cases failed before the fix.
- Real subscription router plus real reconciliation: 19 passed.
Call-count regressions failed before the fix; canceled former
subscribers now use exactly one existing Subscription.retrieve on each
of six platforms. Only iOS/Android past_due readers add
Invoice.retrieve; desktop/web and hidden billing UI do not.
- Related backend tests: subscription plans 69, lapsed-paid
reconciliation 6, users router 327, BYOK security 43, subscription
caches 70 passed.
- Flutter 3.44.5 Home row: 13 passed, including accurate copy, largest
text, exposure deduplication, duplicate taps, loaded-portal timing and
portal failure.
- Native payment web-view load callback: 3 passed; successful page
reports once, about:blank and resource/HTTP failure pages do not report
opened.
- `scripts/l10n.py check` passes with pinned Flutter 3.44.5: 49 locales,
4350 keys. Static analysis of the changed Dart sources and tests reports
no issues.
- All 51 selected repository checks passed on source `4e7904d217`,
across the initial and resumed run. The two required line-count
declarations were supplied, and localization was rerun with pinned
Flutter after the resumed shell selected the machine's older SDK.
- Native proof was refreshed on source `4e7904d217`: light, dark,
largest text, German/Japanese/Arabic, three loaded portal visits, paid
refresh and relaunch. The raw 20.48-second MP4 ends with Pro restored
and recovery absent. All non-GET stub calls were audited: 7
fixture-control POSTs and 3 existing billing-portal session POSTs; zero
charge or subscription-change calls.
- New capture tooling used the shared guarded lane, with an opt-in
180-second Firebase startup deadline after one Auth timeout. No live
Stripe, flag, rollout or release action was taken. Push uses the
authorized pre-push fallback after local gate work exceeded 20 minutes;
all 51 selected checks passed.
## Not verified
- Real Stripe portal/card entry, real payment recovery and webhook
timing. No real payment was attempted.
- Physical iPhone and Android runtime. Evidence is an iPhone simulator
with seeded accounts.
- Production behavior, recovered churn and Home reach. This PR is a
draft and is not deployed.
- Known existing limitation: at the largest accessibility text size,
main already overflows the Home/Tasks header, conversation rows and chat
input. The new recovery row is fixed and tested at this size; those
surrounding controls are outside this proposal. German also has a small
existing bottom/input overflow.
## Follow-up for Nik
Should past_due keep Pro during Stripe's retry window instead of
dropping to Basic? This proposal preserves the current entitlement
behavior.
## Invariants
The shared OmiButton adds an opt-in pill shape for the approved Update
control; its UX contract documents the option. No entitlement policy
changed. The row uses Omi tokens, OmiButton, OmiFeedback and the
existing payment web view; visibility is server-authorized. INV-UI-1,
INV-UI-3 and INV-PERF-1 are preserved. The additive response preserves
released-client compatibility.
Line-Count-Exception: backend/routers/users.py | 2767 -> 2772 | Share
the existing reconciliation snapshot with mobile recovery without adding
a second Stripe lookup.
Line-Count-Exception: backend/utils/subscription.py | 2237 -> 2242 |
Return the already retrieved Stripe snapshot through an optional
request-local output; preserve existing reconciliation callers.
Failure-Class: none
UI-Evidence: see the images above
(.agent-artifacts/ui-evidence/mux-2026-10-29-card-declined/)
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
What changed and why
Monthly plans churn about 9x faster than annual (17.8% vs 2.0% a month, MUX baseline 2026-10-28), and "too expensive" is the top cancel reason (30-32%). Omi Pro is the only plan sold: US$29.99 a month or US$269.91 a year. Twelve months cost US$359.88, so yearly saves US$89.97 a year. Today a monthly payer only reaches yearly through the plan grid, which schedules the change for the end of the month: 7 of 779 Omi Pro monthly subscriptions have one queued. Source: live Stripe, read-only key, 2026-10-29 01:35 UTC (prices
price_1TuIa81F8wnoWYvw0iX0j5M8= 2999 usd/month,price_1TuIap1F8wnoWYvwHWq0EvNU= 26991 usd/year).This PR offers Omi Pro monthly payers the existing yearly price. It adds no new price, coupon or discount.
Backend:
GET /v1/payments/yearly-switch[?preview=true](utils/yearly_switch.py) returns eligibility, the saving and, with preview,Invoice.create_preview(amount due today, renewal date, proration date). Amounts are read from Stripe (the subscription's price and the configured yearly price), never from config. Only an active, renewing, undiscounted USD Omi Pro monthly subscription on its configured monthly price qualifies:cancel_at_period_endorcancel_at)POST /v1/payments/upgrade-subscriptiongets an opt-inswitch_now(+proration_date,expected_amount_due). The same-plan monthly→yearly change then goes through the immediate branch withproration_behavior=always_invoiceandpayment_behavior=error_if_incomplete, at the date the reader saw. The server re-runs the preview at that date and refuses (409) unless Stripe would charge exactly the amount on screen. The call carries an idempotency key bound to that preview, so a double tap charges once. Withoutswitch_nownothing changes: it is still scheduled for the period end.switch_nowrefuses trialing subscriptions with 409, and so does any trial_end in the future. The offer never shows to trials.error_if_incompletemakes Stripe reject the change on a decline. The endpoint returns 402 before writing anything, so Firestore and Stripe both stay on monthly.Events (registry,
subscription-funnelconsumer):Subscription Yearly Switch Shown / Opened / Confirmed / Succeeded / Failed (reason: declined | refused | preview_unavailable | error) / Dismissed, each withsurface: home | plans.Metric estimate (MODELED): if 10% of the 540 eligible Omi Pro monthly payers switch (~54 people), monthly churn goes 10.5% → ~10.2% and LTV $227 → ~$233 (MUX baseline 2026-10-28: churn 10.456% ACTUAL, LTV $227.41 MODELED).
Basis: live Stripe, 2026-10-29: 779 Omi Pro monthly subscriptions (active, trialing or past_due); 540 (69%) pass every offer rule with the PR's own
refusal(); refused: 163 trialing/past_due, 69 cancel scheduled, 7 change scheduled. 304 of the 540 are past their first month (the Home row's audience); all 540 see the Plans & Billing row. Each switcher moves from 17.8% to 2.0% monthly churn: 54 × 15.8 pt over the 2,783 paid subscribers in the baseline window ≈ -0.3 pt. Each switcher's MRR drops US$7.50 (US$29.99 to US$22.49 a month), so ARPU falls ~0.6%; LTV = ARPU / churn ≈ $227 × 0.994 × 1.03 ≈ $233. Legacy monthly prices (for example the $19.99 Unlimited) are out of scope; offering them a term is a pricing decision.Product invariants affected
none
How it was verified
get_offerpreview and the realupgrade_subscription_endpoint(Firestore/Redis mocked). Run 2026-10-28 18:16; the backend money code is byte-identical at this head (git diff a483d9c44e HEAD -- backend/utils/yearly_switch.py backend/routers/payment.pyis empty):metadata.omi_yearly_switch=in_apppm_card_chargeCustomerFail): 402, still monthly, no paid switch invoice, no Firestore writeInvoice.create_preview(prorated like Stripe), the price swap, or Stripe'scard_declinederror. Paths run: Home row → preview → Switch → success → Done, after which the row is gone (the stub's subscription is now on the yearly price, 365-day period). Plans & Billing row → preview → declined card → "Payment declined. You're still on monthly." (the stub's subscription stays on the monthly price). Light and dark. Shot at0ad7aeb3ff(this PR on main @d60cd2eab6); the later merge of main changed no file of this PR outside the regenerated OpenAPI clients. BEFORE is main @d60cd2eab6, same seed and same screens.UI evidence
Simulator (iPhone 17 Pro, iOS 26.2), seeded Omi Pro monthly subscriber in their 2nd paid month. Before = main.
What the stub (standing in for Stripe) recorded on the Home run: the preview at proration date
1793239498(the sheet's US$244.92), the server re-running that same preview at confirm, then oneSubscription.modifywithalways_invoice,error_if_incomplete, the same proration date andmetadata.omi_yearly_switch=in_app. Its subscription moved fromprice_1TuIa81F8wnoWYvw0iX0j5M8(30-day period) toprice_1TuIap1F8wnoWYvwHWq0EvNU(365-day period). On the declined run it stayed on the monthly price.Videos (this MacBook):
~/mobile-ux-agent/runs/2026-10-29/pr23764/after/yearly-switch-home-light/demo.mp4,.../yearly-switch-plans-light/demo.mp4,.../yearly-switch-home-dark/demo.mp4; main:.../pr23764/before/yearly-switch-light/demo.mp4.UI-Evidence: see the images above (
.agent-artifacts/ui-evidence/yearly-switch/).Tests
test_yearly_switch.py58 passed,test_payment_declined_proration.py26 passed. Every payment, subscription, billing, storefront, plan-catalog, checkout, OpenAPI and route-policy test file passes when run on its own (55 files, 0 failures; the repo runs backend files isolated).yearly_switch_test.dart+ plans sheet, contextual plans fallback, Home daily recaps toggle (feat(app): hide Daily Recaps on Home by default, opt in from Developer Settings #23924) and navigation, storefront API, plans l10n, analytics registry and spine B1 home/conversations/settings: 197 passed (Flutter 3.44.5).dart analyzeon changed files: no issues.l10n.py checkok (49 locales, 4321 keys). Pre-push preflight passed.At ship
gh workflow run gcp_backend.yml -f environment=prod -f release_sha=<merged-main-SHA>. The app shows nothing until the backend servesGET /v1/payments/yearly-switch: a 404 hides both rows.Subscription Cancel …events; confirm the PostHog keep rule (subscri) matches them before reading the funnel.metadata.omi_yearly_switch=in_app, so switchers can be counted in Stripe.Failure class (fixes)
Failure-Class: none
Line-Count-Exception: app/lib/backend/preferences.dart | 1630 -> 1635 | one typed accessor for the Home row's 30-day window, beside its neighbours
Line-Count-Exception: backend/routers/payment.py | 1967 -> 1981 | switch_now request fields and the guard on the existing plan-change endpoint; the rules live in utils/yearly_switch.py