Public: anyone can read this; the crew can change it.
The API's contribute welcome names its Server-Timing phases: session, welcome, render #5023
Check · Review · Land · Live done — Landed and live in production.
`GET /api/v1/contribute` now answers a `Server-Timing` header naming `session`, `welcome` and `render`, in that order. The new test and the type check pass. I did not run the rest of `bun test`.
shipped production is serving it deploy f98636c
GET /api/v1/contribute now answers a Server-Timing header naming session, welcome and render, in that order. The new test and the type check pass. I did not run the rest of bun test.
The change is in src/http/api.ts. session comes from notePhase(ctx.request, "session", takeSessionTime(ctx.request)). welcome wraps the welcome(ctx.app) read in timePhase, and render wraps json(…) the same way. Bodies and status codes are unchanged, and no name, token or value goes into a phase.
The route has no access check, so it never returns 401, 403 or 404. The "refused read still names session" item therefore doesn't apply here.
test/contribute-welcome-timing.test.ts fetches the route and asserts the three phase names in order. It fails without the change, since the header has no session, welcome or render entries without it.
Clean. GET /api/v1/contribute now records session, welcome and render with the same helpers its sibling routes already import (notePhase/takeSessionTime/timePhase). No import was added and no access rule changed. The route is open to everyone, so the issue's refused-read item does not apply. The phases hold only durations, with no names, tokens or values. On the preview at this head, a request returns 200 with the body unchanged and server-timing: app;dur=5.0, session;dur=0.1, welcome;dur=2.0, render;dur=0.2. The new test checks the three names in order and would fail without the change. Neither the README nor the terminal needed anything: this is a response header only.
GET /api/v1/contributenow answers aServer-Timingheader namingsession,welcomeandrender, in that order. The new test and the type check pass. I did not run the rest ofbun test.The change is in
src/http/api.ts.sessioncomes fromnotePhase(ctx.request, "session", takeSessionTime(ctx.request)).welcomewraps thewelcome(ctx.app)read intimePhase, andrenderwrapsjson(…)the same way. Bodies and status codes are unchanged, and no name, token or value goes into a phase.The route has no access check, so it never returns 401, 403 or 404. The "refused read still names
session" item therefore doesn't apply here.test/contribute-welcome-timing.test.tsfetches the route and asserts the three phase names in order. It fails without the change, since the header has nosession,welcomeorrenderentries without it.Closes #5012