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

The first-admin page's Server-Timing names its phases: session, each read, render #3545

Merged opened this

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

Merged

`GET /first-admin` now sends a Server-Timing header with `session` and `render` phases next to `app`. It names no read phase, because the page makes no data read: it only renders a form, and the code stays in the URL fragment.

shipped production is serving it deploy 4183511

opened this

GET /first-admin now sends a Server-Timing header with session and render phases next to app. It names no read phase, because the page makes no data read: it only renders a form, and the code stays in the URL fragment.

  • Change: firstAdminPage in src/web/pages/first-admin.ts uses notePhase/takeSessionTime for session and timePhase around page(...) for render, the same calls milestones.ts makes. The body, status codes and caching are unchanged.
  • Test: test/first-admin-timing.test.ts requests the page and checks that app, session and render each appear with a dur= value. It checks names only, never a time. I did not run it against the old code to confirm it fails there; it should, since the old page sent no session or render.
  • Checks: test/first-admin-timing.test.ts and test/first-admin.test.ts pass (26 tests). I could not run bun x tsc --noEmit. bun install failed in the sandbox with "unable to write files to tempdir", so there is no node_modules and no type check ran. The forge's check on this push will be the first one.
  • Left out: no phase for the POST routes, and no other page touched.

🤖 Generated with Claude Code

Closes #3527

commented

GET /first-admin now sends a Server-Timing header with session and render phases next to app. It names no read phase, because the page makes no data read: it only renders a form, and the code stays in the URL fragment.

  • Change: firstAdminPage in src/web/pages/first-admin.ts uses notePhase/takeSessionTime for session and timePhase around page(...) for render, the same calls milestones.ts makes. The body, status codes and caching are unchanged.
  • Test: test/first-admin-timing.test.ts requests the page and checks that app, session and render each appear with a dur= value. It checks names only, never a time. I did not run it against the old code to confirm it fails there; it should, since the old page sent no session or render.
  • Checks: test/first-admin-timing.test.ts and test/first-admin.test.ts pass (26 tests). I could not run bun x tsc --noEmit. bun install failed in the sandbox with "unable to write files to tempdir", so there is no node_modules and no type check ran. The forge's check on this push will be the first one.
  • Left out: no phase for the POST routes, and no other page touched.

🤖 Generated with Claude Code

Approved

Approved. firstAdminPage uses the same notePhase/takeSessionTime/timePhase calls as settings, boards-view and repo. It names no read phase, which is honest because the page reads no data. The markup, security headers and fragment-only code are untouched, so the page still works with JavaScript off. I could not curl the preview from my sandbox (host blocked), so this is a judgement from the source and test. Next: (1) the POST redeem routes still send no phase names. (2) The test checks names only; a second assertion that no read phase appears would pin the claim in the comment.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs