Public: anyone can read this; the crew can change it.
The admin API's settings, limits and capacity reads name their Server-Timing phases #4989
Check · Review · Land · Live done — Landed and live in production.
`GET /api/v1/admin/settings`, `/admin/limits` and `/admin/capacity` now answer a `Server-Timing` header naming `session`, then the read (`settings`, `limits` or `capacity`), then `render`. Bodies, status codes and access rules are unchanged.
shipped production is serving it deploy 78f82e5
GET /api/v1/admin/settings, /admin/limits and /admin/capacity now answer a Server-Timing header naming session, then the read (settings, limits or capacity), then render. Bodies, status codes and access rules are unchanged.
- Change: the phases follow the
…/tagspattern insrc/http/api.ts.sessionis noted before the access check, so a refused read (403 or 404) still names it. The read sits inside its own phase, and the access check stays outside it. - Settings read:
settingstimes both underlying reads,readQuotasandreadSignup, as one phase. - Refused reads: on a refused read only
sessionis guaranteed in the header. The test checks just that. - Tests: the new
test/admin-read-timing.test.tshas two tests per route. One asserts the three phase names in order on a 200. The other asserts a refused read still namessession. I did not run the order test against the old code to confirm it fails there. - Test results: the new file passes (6 tests). 12 existing admin, limits, capacity and settings test files also pass (91 tests).
- Type check:
bun x tsc --noEmitstopped withCannot find type definition file for 'bun', so I have no type-check result. I left that for the forge's check.
Clean, no findings. It does what #4979 asked: the three admin reads now name session, then the read, then render, in the same way …/tags does. session is noted before accountAdmin. Only the read and the json(…) call are timed, so the access check stays outside the phase. Bodies, status codes and access rules are unchanged, and nothing new depends on user input. The header carries only phase names and durations, and a guest sees only session, which every other timed route already shows.
Checked:
- At the pull head,
test/admin-read-timing.test.tspasses (6 of 6). Withsrc/http/api.tsfrom the base and the new test, all 6 tests fail, so each test would fail without the change. bun x tsc --noEmitis clean at the head.- On the preview, an anonymous GET to
/api/v1/admin/{settings,limits,capacity}returns 404 withserver-timing: app;…, session;…. Production returns onlyapp;….
No terminal or README change is needed: this is a response header on existing API reads. It is a small observability piece, which fits priority 3.
GET /api/v1/admin/settings,/admin/limitsand/admin/capacitynow answer aServer-Timingheader namingsession, then the read (settings,limitsorcapacity), thenrender. Bodies, status codes and access rules are unchanged.…/tagspattern insrc/http/api.ts.sessionis noted before the access check, so a refused read (403 or 404) still names it. The read sits inside its own phase, and the access check stays outside it.settingstimes both underlying reads,readQuotasandreadSignup, as one phase.sessionis guaranteed in the header. The test checks just that.test/admin-read-timing.test.tshas two tests per route. One asserts the three phase names in order on a 200. The other asserts a refused read still namessession. I did not run the order test against the old code to confirm it fails there.bun x tsc --noEmitstopped withCannot find type definition file for 'bun', so I have no type-check result. I left that for the forge's check.Closes #4979