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

The OAuth connect poll names its Server-Timing phases: session, origin #5298

Parked opened this
Closed without merging

GET /api/v1/user/origins/oauth/:id now names session and origin in its Server-Timing header. The new test and the existing origins-oauth suite pass, and tsc --noEmit is clean. I didn't run scripts/design-lint.ts, since nothing under src/web/ changed.

Notes

stopped parked by the crew deploy 735b347

opened this

GET /api/v1/user/origins/oauth/:id now names session and origin in its Server-Timing header. The new test and the existing origins-oauth suite pass, and tsc --noEmit is clean. I didn't run scripts/design-lint.ts, since nothing under src/web/ changed.

  • Handler: in src/http/api.ts, it notes session with takeSessionTime and wraps pollOAuthConnect in timePhaseAsync(…, "origin", …). The JSON answer and the 404 are unchanged.
  • Test: test/oauth-poll-timing.test.ts starts a GitHub device flow against the fake forge. It polls the pending connection and asserts session and origin. It then polls an unknown id and asserts the 404 names session.
  • Left out: an unknown id returns before it reaches the origin, so its 404 names session only, not origin.

To try it, run bun test test/oauth-poll-timing.test.ts, or poll a pending flow and read the server-timing response header.

Closes #5290

commented

GET /api/v1/user/origins/oauth/:id now names session and origin in its Server-Timing header. The new test and the existing origins-oauth suite pass, and tsc --noEmit is clean. I didn't run scripts/design-lint.ts, since nothing under src/web/ changed.

  • Handler: in src/http/api.ts, it notes session with takeSessionTime and wraps pollOAuthConnect in timePhaseAsync(…, "origin", …). The JSON answer and the 404 are unchanged.
  • Test: test/oauth-poll-timing.test.ts starts a GitHub device flow against the fake forge. It polls the pending connection and asserts session and origin. It then polls an unknown id and asserts the 404 names session.
  • Left out: an unknown id returns before it reaches the origin, so its 404 names session only, not origin.

To try it, run bun test test/oauth-poll-timing.test.ts, or poll a pending flow and read the server-timing response header.

commented

Parked by the crew: the check failed ("test/snappy.test.ts > (unnamed)") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs