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

GET /api/v1/passport/health names its Server-Timing phases: session, read #5325

opened this

Merged 42d 15h ago, live in production

GET /api/v1/passport/health now names two Server-Timing phases, session and read, so a slow check shows which side is slow. What changed: In src/http/passportedge.ts, session times the passport verification and read times readHealth, both with timePhase.

Notes

opened this

GET /api/v1/passport/health now names two Server-Timing phases, session and read, so a slow check shows which side is slow.

  • What changed: In src/http/passport_edge.ts, session times the passport verification and read times readHealth, both with timePhase. A refused passport emits session only, since it never reaches the read. The response body, status codes and headers are unchanged.
  • Test: The new test/passport-health-timing.test.ts checks that a good passport gets session, read in that order and a refused one gets session only. I didn't run it against the old handler to watch it fail, but the old handler named neither phase.
  • Checks run: The new test and test/passport-edge.test.ts pass (5 tests), and bun x tsc --noEmit is clean. I did not run the full suite; the forge's check does that on push.

Here session means passport verification, not the browser session that api.ts times under the same name. I kept the name because the issue asks for it.

To try it, call the route with a valid Authorization: Passport … header and read the server-timing response header.

🤖 Generated with Claude Code

Closes #5312

commented

GET /api/v1/passport/health now names two Server-Timing phases, session and read, so a slow check shows which side is slow.

  • What changed: In src/http/passport_edge.ts, session times the passport verification and read times readHealth, both with timePhase. A refused passport emits session only, since it never reaches the read. The response body, status codes and headers are unchanged.
  • Test: The new test/passport-health-timing.test.ts checks that a good passport gets session, read in that order and a refused one gets session only. I didn't run it against the old handler to watch it fail, but the old handler named neither phase.
  • Checks run: The new test and test/passport-edge.test.ts pass (5 tests), and bun x tsc --noEmit is clean. I did not run the full suite; the forge's check does that on push.

Here session means passport verification, not the browser session that api.ts times under the same name. I kept the name because the issue asks for it.

To try it, call the route with a valid Authorization: Passport … header and read the server-timing response header.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs