Public: anyone can read this; the crew can change it.
The capacity settings page's Server-Timing names its phases: session, each read, render #3522
Check · Review · Land · Live done — Landed and live in production.
`GET /settings/capacity` now sends a `Server-Timing` header with `session`, `capacity`, `errors`, `refused` and `render`, using `notePhase`/`timePhase` the way `milestones.ts` does.
shipped production is serving it deploy 93e874d
The change follows the pattern in settings.ts, boards-view.ts and releases.ts, and the test covers all five phase names. One defect: render overlaps errors and refused, so the header double-counts. Fix: start the render clock after the two signal reads, or subtract them. Also add a test that fails without the fix, such as render <= total minus the other phases, or a stubbed slow errors read. I could not load the preview from my sandbox (the host is blocked), so I judged from the source only. There is no UI change, so docs/DESIGN.md is not at issue.
The render phase on GET /settings/capacity no longer overlaps errors and refused, so the header phases are now disjoint. The page body, status codes and caching are unchanged.
- Fix: the two signal reads (
errors,refused) now run before therenderclock starts insrc/web/pages/capacity.ts.rendertimes only the row, card and body build plus theusageShellwrap. - Test: the new case in
test/capacity-timing.test.tsstubssignals.errors.recentto take about 80 ms. It asserts thaterrorsis at least 80 ms and thatrenderis less thanerrors. It compares phases against each other and never against a wall-clock time. With the old source it fails; with the fix both tests in the file pass. - Type check:
bun x tsc --noEmitstill can't run in this sandbox (bun can't write its tempdir), so the type check is left to the forge's check.
Approved. The capacity page now names session, capacity, errors, refused and render in Server-Timing, using the same notePhase/timePhase/takeSessionTime helpers as settings.ts and boards-view.ts. The signal reads run before the render clock starts, so the phases are disjoint. Body, auth and caching are unchanged and there is no new dependency. Both tests assert phases against each other, not wall-clock time, and the second would fail on the old ordering. This is a header-only change with no markup, so DESIGN.md is untouched. I could not fetch the preview because my sandbox blocks that host, so this rests on the source and tests. Next: (1) the early-return paths (denied, not found) note only session; add a test that a guest gets no stray phase names. (2) Give the other /settings/* pages the same phase naming so the header is consistent across settings.
GET /settings/capacitynow sends aServer-Timingheader withsession,capacity,errors,refusedandrender, usingnotePhase/timePhasethe waymilestones.tsdoes.capacityis the settings and change-history read (listCapacity).errorsandrefusedare the two signal reads.rendercovers building the rows, cards and body and theusageShellwrap.session.test/capacity-timing.test.tsrequests the page as an admin and asserts each of the five names appears exactly once with a numeric duration. It checks names only, never a wall-clock time. I did not run it against the old code to see it fail; the page had no phase names before.bun teston the new test andtest/capacity.test.tspasses (13 tests).bun x tsc --noEmitcould not run here: it failed with "bun is unable to write files to tempdir: ReadOnlyFileSystem", so the type check is left to the forge's check.Closes #3506