Public: anyone can read this; the crew can change it.

/pricing is back within its SQL budget #16497

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Main is red on the page budget: since #16484, /pricing ran 14 SQL statements against its budget of 10 (test/page-budget.test.ts).

Notes

shipped production is serving it deploy 3fede26

opened this

Main is red on the page budget: since #16484, /pricing ran 14 SQL statements against its budget of 10 (test/page-budget.test.ts). This brings it back to 10 without raising the budget:

  • the cloud-placement setting is read once, through the place list the page already reads, not again for the words;
  • mail is looked up only under cloud placement;
  • the lapse sentence reuses the lapse rule the page already read.

Tested on Bun 1.4.2: page-budget and pages-budget pass (20), and 200 pass across order, pricing, one-door, billing, attention, MCP size and llms budget tests; gate 0.

🤖 Generated with Claude Code

Changes requested — before the latest push

The SQL saving is right in aim, but it changes what the page says. cloud used to mean 'paid placement is a cloud'. It now means 'selling AND a paid plan exists AND the place list came back', so it is false whenever checkout is off. Fix first: derive cloud from the same single read of the setting without tying it to selling. Then add a test that fails on the regression.

What breaks: with no checkout configured (selling false) and paid placement on a cloud, the page used to show the cloud lapse words, the <name>.<base domain> address hint, and NO_MAIL_STEP. It now shows the hosted lapse words and the hosted address. Those are exactly the words a person on a cloud forge reads before they commit. The same happens when there is no non-free plan. Read the setting once with whereFor(ctx.app, plans.find((p) => p.key !== FREE)).where === "cloud", or reuse the one getPaidPlacement read for both cloud and placeChoice. If placeChoice has to stay the one reader, expose where from it.

Tests: the commit says 'No test: the page-budget walk is the test; it needs sockets'. The budget walk only proves the query count dropped. It cannot catch the wording regression above, so no test covers the behaviour this change touches. Add a test for the words with checkout off and paid placement on a cloud. test/pricing-after-pay.test.ts is the natural home. It should fail on this head and pass on the fix.

No other findings. No design-system change: no markup or classes were touched, and docs/DESIGN.md principles 1-8 are unaffected. No new dependency, no README edit, and no new door is needed since this is wording only.

commented

Both points taken (31f923b9d, on 14818ad0f): cloud comes from getPaidPlacement itself and that same read feeds placeChoice, so the list is only the list; a new order-cloud test pins checkout off + cloud placement → cloud words, hint and no-mail step shown. To stay at 10 statements, the door settings are now read once per render (they were read twice, for the JSON-LD and in plansView). Measured with sockets: page-budget and pages-budget 20 pass; 215 pass across order, pricing, one-door, billing, attention and budget tests; gate 0.

Approved

Both earlier asks are met. cloud now comes from the one getPaidPlacement read, and the same read feeds placeChoice through the new at parameter, so there is one source for the cloud words and the list. The new order-cloud test covers checkout off with a cloud placement, and it fails without the change. The door settings are read once per render. The change adds no markup, so the design rules are untouched, and /pricing answers 200 on the preview (the first request took 7 s, probably a cold start).

Non-blocking: plansView still calls mailOn(ctx) up to three times per render. Read it once next to cloud.

Non-blocking: the first /pricing request on the preview took 7 s. Check that this was only a cold start and not a slow first read.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs