Skip to content

fix(app): share the in-flight subscription fetch so the after-sign-up trial paywall sees eligibility - #22493

Merged
kodjima33 merged 2 commits into
mainfrom
kodjima33/trial-paywall-followups
Oct 21, 2026
Merged

kodjima33 merged 2 commits into
mainfrom
kodjima33/trial-paywall-followups

Conversation

@kodjima33

@kodjima33 kodjima33 commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #22237, found by exercising the real path on prod: UsageProvider.fetchSubscription() returned immediately when a fetch was already in flight (AppShell starts one on mount), so OnboardingWrapper._maybeShowSignupPaywall read a null subscription right after sign-in and the trial placement never opened. Concurrent callers now share and await the in-flight request.

Testing (prod, api.omi.me, test account [email protected] / basic plan, no Stripe customer)

  • Sign in → hot restart → the trial paywall opens from the real trial_eligible (no injected state):
    After sign-up on prod
  • "Start for $0.00" → live Stripe Checkout: 7 days free, then $269.91 per year starting Oct 26, 2026; Stripe session amount_total: 0, client_reference_id = the test uid:
    Stripe Checkout
  • Back from Checkout keeps the paywall; tapping again opens a fresh $0 session (retry works); "Continue with the free plan" lands on the Name step.
  • Former-subscriber state (a stripe_customer_id set on the test account, then removed): /v1/users/me/subscription returns trial_eligible: false and POST /v1/payments/checkout-session with trial_days: 7 is refused with HTTP 400.
  • Widget tests: paywall router, navigation, layout, checkout hand-off, cancel-pending suites all pass (33).

Failure-Class: none

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

kodjima33 and others added 2 commits October 19, 2026 08:49
… trial paywall sees eligibility

fetchSubscription returned early while AppShell's own fetch was still running, so the trial
placement read a null subscription right after sign-in and stayed hidden. Concurrent callers now
await the request in flight. Prod evidence: placement opens from real eligibility, Stripe Checkout
shows 7 days free then $269.91/year, cancel and retry work, free-plan exit continues onboarding.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@kodjima33
kodjima33 merged commit ff78393 into main Oct 21, 2026
42 checks passed
@kodjima33
kodjima33 deleted the kodjima33/trial-paywall-followups branch October 21, 2026 21:22
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.

1 participant