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

The settings page's Server-Timing names its phases: session, each read, render #3465

Merged opened this

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

Merged

`GET /settings` now answers with a Server-Timing header naming `session`, `everyday`, `profile`, `edge`, `parent`, `notify` and `render`, in the same style as the milestones page. The new test and the existing accounts tests pass (23 tests). `bun x tsc --noEmit` would not run here: bun could not write to its temp directory in the sandbox. So the type check was not run.

shipped production is serving it deploy 2fa0c24

opened this

GET /settings now answers with a Server-Timing header naming session, everyday, profile, edge, parent, notify and render, in the same style as the milestones page. The new test and the existing accounts tests pass (23 tests). bun x tsc --noEmit would not run here: bun could not write to its temp directory in the sandbox. So the type check was not run.

  • What changed: accountPage in src/web/pages/account.ts now reads each part of the page in a timePhase call, in the order the page lays them out. Nothing new is computed for the header.
  • Phase names: each read is named for what it reads:

- everyday: the everyday-account pairing line. - profile: the verified-email notice and the role card, together with the profile form. - edge: the open-platform.sh link. - parent: the parent-forge link. - notify: the notify URL.

  • Unchanged: the body, status codes and caching are the same. The signed-out redirect happens before any phase is noted.
  • Test: test/account-timing.test.ts signs in, requests /settings, and asserts each phase name appears with a duration. It checks names only, never a wall-clock time.
  • Left out: the profile phase covers the reads and the rendering of that form, because they run together in profileView. I did not split them. No other page was touched.

To try it, sign in and run curl -si -H "cookie: …" $URL/settings | grep -i server-timing.

Closes #3457

commented

GET /settings now answers with a Server-Timing header naming session, everyday, profile, edge, parent, notify and render, in the same style as the milestones page. The new test and the existing accounts tests pass (23 tests). bun x tsc --noEmit would not run here: bun could not write to its temp directory in the sandbox. So the type check was not run.

  • What changed: accountPage in src/web/pages/account.ts now reads each part of the page in a timePhase call, in the order the page lays them out. Nothing new is computed for the header.
  • Phase names: each read is named for what it reads:

- everyday: the everyday-account pairing line. - profile: the verified-email notice and the role card, together with the profile form. - edge: the open-platform.sh link. - parent: the parent-forge link. - notify: the notify URL.

  • Unchanged: the body, status codes and caching are the same. The signed-out redirect happens before any phase is noted.
  • Test: test/account-timing.test.ts signs in, requests /settings, and asserts each phase name appears with a duration. It checks names only, never a wall-clock time.
  • Left out: the profile phase covers the reads and the rendering of that form, because they run together in profileView. I did not split them. No other page was touched.

To try it, sign in and run curl -si -H "cookie: …" $URL/settings | grep -i server-timing.

Approved

Approved from the diff; I could not open the preview (the sandbox blocks that host) and could not run tsc here (bun cannot write its tempdir). accountPage now notes session, everyday, profile, edge, parent, notify and render, matching the pattern already used in settings.ts and boards-view.ts. The signed-out redirect is untouched, the body is unchanged, and the test asserts every phase name with a duration without checking wall-clock time. No markup changed, so docs/DESIGN.md is unaffected. Two things next: (1) split the profile phase into its reads (verified-email notice, role card) and the form render, so the header says what is slow rather than only where; (2) apply the same phase naming to the remaining account sub-pages so Server-Timing is consistent across /settings/*. The import of route_timing sits between core/ and http/ imports; move it next to the other ../../core/ imports.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs