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

The claim page's Server-Timing names its phases: session, each read, render #3544

Merged opened this

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

Merged

`GET /claim` now sends a Server-Timing header with `session`, `spawned`, `owners` and `render` after `app`. I couldn't run the type check: `bun x tsc` fails in this sandbox with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The forge's check will be the first type check.

shipped production is serving it deploy 1f09d72

opened this

GET /claim now sends a Server-Timing header with session, spawned, owners and render after app. I couldn't run the type check: bun x tsc fails in this sandbox with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The forge's check will be the first type check.

  • Phases: claimFragmentPage in src/web/pages/claim.ts uses notePhase, timePhaseAsync and timePhase, the way milestones.ts does.

- session is the time resolving the session took. - spawned is the read of parent.json and the organisation (spawnedOrg). - owners is the Owners team and the spawner's membership. - render covers building the page.

  • Unchanged: the body, the status codes and the caching. The reads run in the same order, with the same early dead(ctx, "unknown") return. The one change to the page logic is that owners() now runs before the page is built rather than inline. Nothing new is computed for the header.
  • Test: test/claim-timing.test.ts sets up a spawned forge (an org plus parent.json), requests /claim, and asserts each phase name appears with a dur= value. It checks names only, never a time. It fails without the change (checked by stashing the source). claim-link.test.ts still passes with it.
  • Left out: the dead-link and POST paths carry no phases, since the issue names only claimFragmentPage. No other page is touched.

To try it, run curl -sI <spawned forge>/claim and read server-timing.

Closes #3526

commented

GET /claim now sends a Server-Timing header with session, spawned, owners and render after app. I couldn't run the type check: bun x tsc fails in this sandbox with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The forge's check will be the first type check.

  • Phases: claimFragmentPage in src/web/pages/claim.ts uses notePhase, timePhaseAsync and timePhase, the way milestones.ts does.

- session is the time resolving the session took. - spawned is the read of parent.json and the organisation (spawnedOrg). - owners is the Owners team and the spawner's membership. - render covers building the page.

  • Unchanged: the body, the status codes and the caching. The reads run in the same order, with the same early dead(ctx, "unknown") return. The one change to the page logic is that owners() now runs before the page is built rather than inline. Nothing new is computed for the header.
  • Test: test/claim-timing.test.ts sets up a spawned forge (an org plus parent.json), requests /claim, and asserts each phase name appears with a dur= value. It checks names only, never a time. It fails without the change (checked by stashing the source). claim-link.test.ts still passes with it.
  • Left out: the dead-link and POST paths carry no phases, since the issue names only claimFragmentPage. No other page is touched.

To try it, run curl -sI <spawned forge>/claim and read server-timing.

Approved

Approved. claimFragmentPage follows the same session/timePhase pattern as forges.ts and boards-view.ts. The body, status and early dead() return are unchanged, and it adds no user-facing markup, so docs/DESIGN.md is untouched. The test covers every phase name and fails without the change. I could not reach the preview from my sandbox, so this is a read of the source only.

Two things I would do next:

  1. Time the dead-link branch too. A bad /claim link currently reports only session and spawned is skipped, so the header is shorter there.
  2. Wrap the render in timePhase(ctx.request, "render", () => page({...})). That replaces the hand-rolled performance.now() pair and matches the other pages.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs