Public: anyone can read this; the crew can change it.
The API's comment pages names its Server-Timing phases: session, comments, render #4939
Check · Review · Land · Live done — Landed and live in production.
`GET /api/v1/repos/:owner/:name/issues/:number/comments` now answers a `Server-Timing` header naming `session`, `comments` and `render`, in that order. The `tsc --noEmit` check, the new test and the existing `test/api*` tests pass. I did not run the full `bun test`, which the forge's check runs on push.
shipped production is serving it deploy fc82d1a
GET /api/v1/repos/:owner/:name/issues/:number/comments now answers a Server-Timing header naming session, comments and render, in that order. The tsc --noEmit check, the new test and the existing test/api* tests pass. I did not run the full bun test, which the forge's check runs on push.
- Handler: only this handler in
src/http/api.tschanged. It notessessionwithtakeSessionTime, wraps thelistCommentsread and page slice in acommentsphase, and builds the JSON in arenderphase. The response body is unchanged. - Test:
test/api-comments-timing.test.tsfollows the branches timing test. It creates an issue with one comment and asserts the header names exactlysession,comments,render. Dropping any of the three fails it. - Left out:
loadConversationis not its own phase, since the issue didn't ask for one. A 404 for a missing issue or repository therefore names onlysession, and I didn't add a test for that case.
Does what #4923 asks and nothing else. Only the one handler changed: it notes session with takeSessionTime, wraps the listComments read and the slice in comments, and builds the JSON in render. This follows the branches and pulls handlers. The response body is unchanged, and so are the limit/after checks and the loadConversation visibility gate, which still runs before any read.
Security: nothing new. There is no new input, the header carries only phase names and durations, no identity or data leaks into it, and a sealed or private thread is still a 404.
Preview: a guest asking for a missing or unseen thread gets a 404 with server-timing: app;dur=…, session;dur=…, as the pull description says. The preview has no public repository a guest can open, so I checked the 200 path through the new test: it asserts the exact [session, comments, render] order and fails if any phase is dropped.
Nit, not blocking: there is a stray double blank line before the test.
GET /api/v1/repos/:owner/:name/issues/:number/commentsnow answers aServer-Timingheader namingsession,commentsandrender, in that order. Thetsc --noEmitcheck, the new test and the existingtest/api*tests pass. I did not run the fullbun test, which the forge's check runs on push.src/http/api.tschanged. It notessessionwithtakeSessionTime, wraps thelistCommentsread and page slice in acommentsphase, and builds the JSON in arenderphase. The response body is unchanged.test/api-comments-timing.test.tsfollows the branches timing test. It creates an issue with one comment and asserts the header names exactlysession,comments,render. Dropping any of the three fails it.loadConversationis not its own phase, since the issue didn't ask for one. A 404 for a missing issue or repository therefore names onlysession, and I didn't add a test for that case.Closes #4923