fix(studio): guard priceMonthly lookup on new project page#46395
Conversation
Replace unsafe `instanceSizeSpecs[instanceSize]!.priceMonthly` lookups
in `pages/new/[slug].tsx` and `ProjectCreationFooter.tsx` with the
existing `monthlyInstancePrice` helper, which falls back to micro pricing
on unknown values. Fixes a render crash that fires when users switch
between organizations of different plan tiers via the OrganizationSelector
dropdown (form state persists across `router.push('/new/<slug>')`, so an
instanceSize from the previous org can briefly mismatch instanceSizeSpecs).
Fixes FE-3481
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
📝 WalkthroughWalkthroughThis PR consolidates pricing calculations across the project creation flow by replacing direct lookups in ChangesCentralize monthly pricing calculations
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
🎭 Playwright Test ResultsDetails
Flaky testsFeatures › cron-jobs.spec.ts › Cron Jobs › High Query Cost Banner › cleanup workflow: delete rows and schedule cleanup job Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
Braintrust eval reportAssistant (bt::sp::custom::GitHub Actions-e1f8e343-7ee3-4763-ae7f-62d4550a6e7c-1779818721)
|
Summary
Switches the two
instanceSizeSpecs[instanceSize]!.priceMonthlylookups (on the New Project page and its footer) to the existingmonthlyInstancePricehelper, which has a defensive fallback. Fixes a render crash that fires when users switch between organizations of different plan tiers via the OrganizationSelector dropdown.Sentry: SUPABASE-APP-EJT — 339 occurrences, 312 users impacted.
Fixes FE-3481
Test plan
/dashboard/new/<freeOrgSlug>, open the org dropdown and switch to a paid org — no crashpnpm typecheckpassesSummary by CodeRabbit