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

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

Merged opened this

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

Merged

`GET /settings/accounts` now answers with a Server-Timing header that names `session`, `accounts`, `mail`, `orphans`, `owned` and `render`. The new test and the existing accounts tests pass (32 in total). I couldn't run the type check: `bun x tsc --noEmit` failed here with "unable to write files to tempdir", so the forge's check will be its first run.

shipped production is serving it deploy ddc329f

opened this

GET /settings/accounts now answers with a Server-Timing header that names session, accounts, mail, orphans, owned and render. The new test and the existing accounts tests pass (32 in total). I couldn't run the type check: bun x tsc --noEmit failed here with "unable to write files to tempdir", so the forge's check will be its first run.

  • Phases: accountsPage records session the way milestones.ts does. The data reads are wrapped with timePhase: accounts is the account list, mail is whether mail is configured, orphans is the organizations with no active owner, and owned is the per-row sole-owned-organizations lookup. render times building the page. The edits are in src/web/pages/accounts.ts.
  • Moved read: the owned lookup used to run inside the row markup. It now runs once before rendering, as a list indexed by account. It returns the same values and runs after the other reads, as it did before.
  • Unchanged: the body, status codes and caching are the same, and no other page is touched.
  • Test: test/accounts-timing.test.ts requests the page as an admin. It asserts each of the six names appears exactly once with a numeric duration, and never checks a wall-clock time. I did not confirm that it fails without the change.
  • Not done: the POST acts that re-render the page (the 409 refusals) also record the four read phases and render, but not session. I left them that way rather than split the view in two.

Closes #3426

commented

GET /settings/accounts now answers with a Server-Timing header that names session, accounts, mail, orphans, owned and render. The new test and the existing accounts tests pass (32 in total). I couldn't run the type check: bun x tsc --noEmit failed here with "unable to write files to tempdir", so the forge's check will be its first run.

  • Phases: accountsPage records session the way milestones.ts does. The data reads are wrapped with timePhase: accounts is the account list, mail is whether mail is configured, orphans is the organizations with no active owner, and owned is the per-row sole-owned-organizations lookup. render times building the page. The edits are in src/web/pages/accounts.ts.
  • Moved read: the owned lookup used to run inside the row markup. It now runs once before rendering, as a list indexed by account. It returns the same values and runs after the other reads, as it did before.
  • Unchanged: the body, status codes and caching are the same, and no other page is touched.
  • Test: test/accounts-timing.test.ts requests the page as an admin. It asserts each of the six names appears exactly once with a numeric duration, and never checks a wall-clock time. I did not confirm that it fails without the change.
  • Not done: the POST acts that re-render the page (the 409 refusals) also record the four read phases and render, but not session. I left them that way rather than split the view in two.
Approved

Approved. The change follows the pattern in settings.ts, boards-view.ts and forges.ts (notePhase/takeSessionTime/timePhase). Markup, status codes and caching are unchanged, so nothing here departs from docs/DESIGN.md and nothing needs JavaScript. Moving the per-row owned lookup out of the markup keeps the output the same and gives it a name. The test checks each of the six names once with a numeric dur, and no wall-clock value. I could not reach the preview from my sandbox (the host is blocked), so I judged the header from the source and the test only.

Two things I would do next:

  1. Add the missing session phase to the POST re-render path, or split accountsView so a 409 page has the same phases as the GET. It is minor.
  2. Prove the test fails without the change. The builder said that was not checked, and the type check was not run either, so the forge check is the first to run it.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs