Repository navigation
fix(dashboard): keep the onboarding plan step up during a billing refetch - #1111
Conversation
After setup, owners and admins on cloud pick a plan from one card that lists each plan's monthly allowances, price and upgrade action, then open the dashboard or Insights. Checkout returns to the same step. (cherry picked from commit 8c5517d)
The plan step now also needs the onboarding-plan-step flag, so it can reach half of new owners first. Billing only reports an error or a pending check when its data is missing, so a failed plan list or a background refetch no longer turns Open Insights into Open dashboard. Returning to the plan step from checkout or a reload no longer repeats the onboarding started and tracking verified events. (cherry picked from commit efbd272)
…step Members without billing rights no longer see plans while billing loads or fails, the card no longer claims Free when billing failed, and going back to setup after checkout records tracking verification again. (cherry picked from commit 6fa430d)
E2E and self-host builds skip the Autumn provider, so the plan step crashed there. It now needs a live billing build and the onboarding-plan-step flag, and the e2e specs return to main's flow. The pricing table drops props only onboarding used, and the plan step file is named after its component.
|
@FindMalek is attempting to deploy a commit to the Databuddy OSS Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| const showPlanStep = | ||
| step === "plan" && | ||
| Boolean(websiteId) && | ||
| planStepFlagEligible && |
There was a problem hiding this comment.
Checklist still flashes on reload
On a reload with an expired or missing flag cache, isOn("onboarding-plan-step") returns false until the flag loads. That makes showPlanStep false even while billing loads, so the page shows SetupChecklist before switching to ChoosePlan. This leaves the reload fix incomplete. Keep a loading view for a resumed plan step until the flag resolves, and fall back only when it is confirmed off.
4950c0c to
09495e3
Compare
Follow-up to #1096, stacked on
izadoesdev/onboarding-plan-step-releaseso this diff is just the fix.Bug
offersPlansrequires!billing.isLoadingbeforeChoosePlanrenders:On a hard reload while sitting on
?step=plan(e.g. returning from Stripe checkout), billing starts from a cold cache, sobilling.isLoadingis briefly true. During that windowoffersPlansis false, so the gate falls through and rendersSetupChecklistinstead — for however long the billing fetch takes — before flipping toChoosePlanonce it resolves. Someone coming back from paying sees the setup checklist flash before the plan screen shows up.Fix
Split the static eligibility check (self-hosted, e2e, feature flag — none of which depend on billing's network state) from the full
offersPlanscheck used to decide whether to route into the plan step in the first place. AddshowPlanStep, which rendersChoosePlanoptimistically while billing is still loading, and only falls back to the checklist once billing actually resolves and says the user can't upgrade:ChoosePlanalready toleratesbilling.isLoadinggracefully (it shows "Your setup is saved" instead of the plan name), so this doesn't need any change inside that component.offersPlansitself is untouched in meaning — still used as-is for the "Continue" button decision after setup.Note
While tracing this I noticed
isDashboardE2Eunconditionally disables the plan step for the whole e2e run (it's a single process-wide env flag, not per-test), so the existing e2e suite can't actually reachChoosePlanregardless of this fix. Didn't try to solve that here — flagging it since the original PR description mentions e2e coverage for "reload on the plan step," which doesn't look reachable under the current gating. No automated test added for this specific fix as a result; verified by tracing the render logic by hand plustsc --noEmitclean across all 37 packages.Disclosure: implemented with AI assistance (Claude Code); verified by manually tracing both render paths (fresh reload vs. billing already cached) against the actual component logic before submitting.
Summary by cubic
Stops the onboarding flow from flashing
SetupChecklistwhen resuming at?step=plan, such as returning from Stripe checkout. PreviouslyChoosePlanonly rendered after billing finished fetching, so a cold billing state briefly fell through to the checklist; now the plan step renders optimistically while billing loads, and only falls back if billing resolves and says the user can't upgrade.offersPlansis unchanged and still drives the "Continue" button behavior.Note:
isDashboardE2Egates the plan step off for the whole e2e run (it's a process-wide env flag, not per-test), so the existing e2e suite can't actually reachChoosePlan, and no automated test was added for this fix. Verified by hand-tracing the render paths and a cleantsc --noEmit.Written for commit 2dc24d5. Summary will update on new commits.