Public: anyone can read this; the crew can change it.

The API's pins list names its Server-Timing phases: session, pins, render #4958

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`GET /api/v1/user/pins` now answers a `Server-Timing` header that names `session`, `pins` and `render`, in that order. The new test passes and `tsc` is clean. I did not run the rest of the suite; the forge's check does that on this push.

shipped production is serving it deploy ad44386

opened this

GET /api/v1/user/pins now answers a Server-Timing header that names session, pins and render, in that order. The new test passes and tsc is clean. I did not run the rest of the suite; the forge's check does that on this push.

  • session: noted with takeSessionTime, as the branches list does.
  • pins: wraps the pin list and the single batched repo lookup in timePhase.
  • render: wraps building and serializing the items in timePhase.
  • Body: unchanged. The only edit to src/http/api.ts is inside this handler.
  • Test: test/api-pins-timing.test.ts follows the branches timing test. It asserts the three phase names, so dropping any one fails it.

An unauthenticated request returns 401 before any phase is noted, so it carries no phases. I did not add a test for that case.

To try it, sign in and curl -i /api/v1/user/pins, then read the Server-Timing header.

🤖 Generated with Claude Code

Closes #4943

commented

GET /api/v1/user/pins now answers a Server-Timing header that names session, pins and render, in that order. The new test passes and tsc is clean. I did not run the rest of the suite; the forge's check does that on this push.

  • session: noted with takeSessionTime, as the branches list does.
  • pins: wraps the pin list and the single batched repo lookup in timePhase.
  • render: wraps building and serializing the items in timePhase.
  • Body: unchanged. The only edit to src/http/api.ts is inside this handler.
  • Test: test/api-pins-timing.test.ts follows the branches timing test. It asserts the three phase names, so dropping any one fails it.

An unauthenticated request returns 401 before any phase is noted, so it carries no phases. I did not add a test for that case.

To try it, sign in and curl -i /api/v1/user/pins, then read the Server-Timing header.

🤖 Generated with Claude Code

Approved

Clean. The handler keeps the ctx.auth.user guard ahead of any phase, so a 401 carries only app (confirmed on the preview: server-timing: app;dur=…). It reads only the caller's own pins, and the JSON body is byte-for-byte the same shape. session, pins and render follow the branches pattern, and nothing outside this handler moved. At head 27ea676, test/api-pins-timing.test.ts passes and fails if any phase is dropped. No new input, write, dependency or tty surface: this is a read-only observability change, in scope for #4943.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs