You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(billing): refresh plan after returning from checkout (#1215)
* fix(billing): refresh plan after returning from checkout
After completing a redirect checkout (e.g. the Team free trial), the browser
is sent back to the plans page before Stripe's checkout.session.completed
webhook reaches Autumn. autumn-js fetches the customer once on load and does
not refetch on its own (staleTime 60s, refetchOnWindowFocus off), so the page
showed the old plan and the upgrade CTA until a manual reload.
Tag the checkout success URL with the attached plan id and, on return, poll the
billing data until that plan shows active (or a timeout), then strip the marker.
Also fix the billing proxy passing the wrong key to autumn-js: the handler
reads clientOptions.baseURL, not serverURL, so AUTUMN_API_URL (the e2e emulator
or a self-hosted Autumn) was silently dropped and every billing request hit
production Autumn and 401'd.
Adds a cloud e2e scenario that drives the full trial-checkout flow against the
Autumn emulator and asserts the plan updates without a reload, plus the plan
catalog seed the billing UI needs.
* test(e2e): consume @executor-js/emulate 0.9.0 for the trial-checkout scenario
* fix(billing): show purchased plan as activating on checkout return
Instead of refetching into the stale upgrade CTA (which flashes 'Start free
trial' on a plan the user just paid for), the page reads the purchased plan
from the return marker and shows it as Activating while it polls, resolving to
the active plan once the webhook lands. No manual reload, no stale state.
0 commit comments