Public: anyone can read this; the crew can change it.
The API's person read names its Server-Timing phases: session, person, render #4937
Check · Review · Land · Live done — Landed and live in production.
`GET /api/v1/users/:username` now answers a `Server-Timing` header naming `session`, `person` and `render`, in that order. The response body is unchanged.
shipped production is serving it deploy 7cfd21c
GET /api/v1/users/:username now answers a Server-Timing header naming session, person and render, in that order. The response body is unchanged.
A missing or hidden person returns the same 404 as before, with only session and person in the header, since there is nothing to render. This mirrors how the branches list handles its 404.
The change is in the one handler in src/http/api.ts. The person phase wraps the user lookup and the hidden-from-viewer check, and render wraps building the profile JSON.
The new test/api-person-timing.test.ts asserts the exact phase list for a found person and for a missing one, so dropping a phase fails it. It passes along with test/api-branches-timing.test.ts. I did not run the type check: bun x tsc --noEmit fails here because the bun type definitions are missing. I also did not run design-lint, since nothing under src/web/ changed.
To try it, run curl -si $URL/api/v1/users/<name> against a preview and read the server-timing header.
🤖 Generated with Claude Code
Clean, small, matches the timed-route pattern already in api.ts (boards, branches): notePhase(session), then timePhase for person and render, all imported from core/route_timing.ts. Security is unchanged. The hidden-from-viewer check stays inside the person phase, so a hidden person and a missing person give the same 404 with the same phases, and the header does not show which one it was. The response body is the same as before. On the preview, curl -si /api/v1/users/<missing> answers 404 with server-timing: app, session, person. I could not try the 200 path there because the preview has no users, but the new test pins the exact list [session, person, render] for a found person and [session, person] for a missing one, and both would fail without the change. Nothing to change on the terminal or the README for a timing header.
GET /api/v1/users/:usernamenow answers aServer-Timingheader namingsession,personandrender, in that order. The response body is unchanged.A missing or hidden person returns the same 404 as before, with only
sessionandpersonin the header, since there is nothing to render. This mirrors how the branches list handles its 404.The change is in the one handler in
src/http/api.ts. Thepersonphase wraps the user lookup and the hidden-from-viewer check, andrenderwraps building the profile JSON.The new
test/api-person-timing.test.tsasserts the exact phase list for a found person and for a missing one, so dropping a phase fails it. It passes along withtest/api-branches-timing.test.ts. I did not run the type check:bun x tsc --noEmitfails here because thebuntype definitions are missing. I also did not run design-lint, since nothing undersrc/web/changed.To try it, run
curl -si $URL/api/v1/users/<name>against a preview and read theserver-timingheader.🤖 Generated with Claude Code
Closes #4921