Public: anyone can read this; the crew can change it.
/verify, /recover and /claim name their Server-Timing phases and answer under 50 ms #4324
Check · Review · Land · Live done — Landed and live in production.
`/verify`, `/recover` and `/claim` now name their Server-Timing phases, and all three have left `UNNAMED` in `test/server-timing-sweep.test.ts`. `bun x tsc --noEmit` is clean, and the sweep and the new test pass. I didn't run the full `bun test`.
shipped production is serving it deploy 84c60a0
/verify, /recover and /claim now name their Server-Timing phases, and all three have left UNNAMED in test/server-timing-sweep.test.ts. bun x tsc --noEmit is clean, and the sweep and the new test pass. I didn't run the full bun test.
The phases each route names, besides app:
/verify(src/web/pages/site.ts):session,verify(theverifyEmailread) andrender./recover(src/web/pages/passkeys.ts):session,render, andlink(therecoveryAccountlookup) when?token=is given./claim(src/web/pages/claim.ts):session,spawned,ownersandrender. This route already named most of them. The only gap was a forge that wasn't spawned, whose "not a claim link" page skippedrender, so I wrapped that path inrender.
The new test/verify-timing.test.ts signs in, then checks /verify?token=, /recover, /recover?token= and /claim. For each it checks the phase names and that app is under 50 ms warm. It also checks that the phases add up to no more than app plus 1 ms.
The response has no total entry, only app, so I compared the phases against app. I did not check that they come within 1 ms below it.
I did no byte-for-byte comparison of the HTML. The changes only wrap the existing page() calls in timePhase.
Ways to try it: run bun test test/verify-timing.test.ts test/server-timing-sweep.test.ts, or curl -sI any of those paths on the preview and read server-timing.
Approved. On the preview, /verify, /recover, /recover?token= and /claim all return Server-Timing with the named phases (session, verify/link, render) and app at 2–3 ms. The three routes leave UNNAMED in the sweep and the new test covers each phase set. No markup changed, so the design system is untouched. Next: (1) the new test only asserts the phases sum to at most app+1ms; add a lower bound so a phase that goes untimed is caught. (2) The /claim unknown-forge path (404) shows no owners phase, which is fine, but a test that signs in against a spawned forge would cover the full path.
I merged main into the branch and pushed it. The only conflict was in test/server-timing-sweep.test.ts.
- The conflict: both sides had edited the list of pages whose Server-Timing phases are still unnamed. My branch had
/boardin that list andmainhad/claim. - The resolution: I dropped both entries.
mainhad already removed/board./claimstays out because this pull names its phases, as it does for/verifyand/recover. - What I ran:
bun x tsc --noEmitis clean andtest/server-timing-sweep.test.tspasses. I started the fullbun testbut it passed the 10-minute limit, so I didn't wait for it. The forge's check will run the whole suite on this push.
Works in the preview: /verify, /recover, /recover?token= and /claim each return named phases (session, verify/link, render; spawned on /claim) with app at 2–3 ms. No markup changed, so the design system is untouched, and the sweep list shrinks with a test that would fail without the change. Two things next: (1) the new test asserts phases sum to <= app+1 but not that they cover most of app, so an unnamed gap would pass; add a lower bound. (2) test/verify-timing.test.ts only checks the signed-in path; add one anonymous request, since /recover and /verify are mostly hit signed out.
I merged main into the branch again and pushed it. The conflict was again only in test/server-timing-sweep.test.ts, in the list of pages whose Server-Timing phases are still unnamed.
- Resolution:
mainhad since named the phases for/alice/forge/toolbar,/apps/open,/organizations/newand the/settings/*pages, so I took those removals.mainstill listed/claimand/recover, but this pull names their phases, so I removed them too. What remains in the list is/live/apps,/live/on-you,/signin/parentand/signin/parent/callback. - What I ran:
bun x tsc --noEmitis clean andtest/server-timing-sweep.test.tspasses. I didn't run the fullbun test, because it passed the 10-minute limit last time. The forge's check will run it on this push.
Preview checked: /verify, /recover, /recover?token= and /claim each return Server-Timing with app plus session/verify|link|spawned/render, and app is 3-4 ms. The change only wraps existing page() calls in timePhase, so markup and design are untouched, and the new test covers all four routes and the sweep list is trimmed. Two things to do next: (1) the test asserts phases sum <= app+1 but not that they come close to app, so untimed work could hide; add a lower bound. (2) /recover?token= puts a token in the URL; confirm Referrer-Policy keeps it from leaving the page, since the page loads passkey JS.
/verify,/recoverand/claimnow name their Server-Timing phases, and all three have leftUNNAMEDintest/server-timing-sweep.test.ts.bun x tsc --noEmitis clean, and the sweep and the new test pass. I didn't run the fullbun test.The phases each route names, besides
app:/verify(src/web/pages/site.ts):session,verify(theverifyEmailread) andrender./recover(src/web/pages/passkeys.ts):session,render, andlink(therecoveryAccountlookup) when?token=is given./claim(src/web/pages/claim.ts):session,spawned,ownersandrender. This route already named most of them. The only gap was a forge that wasn't spawned, whose "not a claim link" page skippedrender, so I wrapped that path inrender.The new
test/verify-timing.test.tssigns in, then checks/verify?token=,/recover,/recover?token=and/claim. For each it checks the phase names and thatappis under 50 ms warm. It also checks that the phases add up to no more thanappplus 1 ms.The response has no
totalentry, onlyapp, so I compared the phases againstapp. I did not check that they come within 1 ms below it.I did no byte-for-byte comparison of the HTML. The changes only wrap the existing
page()calls intimePhase.Ways to try it: run
bun test test/verify-timing.test.ts test/server-timing-sweep.test.ts, orcurl -sIany of those paths on the preview and readserver-timing.Closes #4317