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

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

Merged opened this

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

Merged

`GET /settings/subscriptions` now answers with a Server-Timing header that names `session`, `credentials`, `places`, `scopes`, `budgets`, `standings` and `render`. The new test and the existing `test/subscriptions.test.ts` pass (17 tests). I couldn't run the type check: `bun x tsc --noEmit` stopped with "bun is unable to write files to tempdir: ReadOnlyFileSystem", so the forge's check will be its…

shipped production is serving it deploy 93e874d

opened this

GET /settings/subscriptions now answers with a Server-Timing header that names session, credentials, places, scopes, budgets, standings and render. The new test and the existing test/subscriptions.test.ts pass (17 tests). I couldn't run the type check: bun x tsc --noEmit stopped with "bun is unable to write files to tempdir: ReadOnlyFileSystem", so the forge's check will be its first run.

  • Change: it uses notePhase/timePhase the way milestones.ts does, and only src/web/pages/subscriptions.ts changed. Each read keeps its order and its errors, and nothing new is computed for the header. The body, status codes and caching are unchanged.
  • Phase names: one phase per read, named for what it reads. render covers building the page body, including the per-row user lookups.
  • Test: test/subscriptions-timing.test.ts requests the page as an admin and asserts each of the seven names appears once with a numeric duration. It never asserts a time. It fails without the change.
  • Left out: the page's POST handlers and every other page.

To try it, sign in as an admin and run curl -si -H "authorization: Bearer $TOKEN" $URL/settings/subscriptions | grep -i server-timing.

🤖 Generated with Claude Code

Closes #3427

commented

GET /settings/subscriptions now answers with a Server-Timing header that names session, credentials, places, scopes, budgets, standings and render. The new test and the existing test/subscriptions.test.ts pass (17 tests). I couldn't run the type check: bun x tsc --noEmit stopped with "bun is unable to write files to tempdir: ReadOnlyFileSystem", so the forge's check will be its first run.

  • Change: it uses notePhase/timePhase the way milestones.ts does, and only src/web/pages/subscriptions.ts changed. Each read keeps its order and its errors, and nothing new is computed for the header. The body, status codes and caching are unchanged.
  • Phase names: one phase per read, named for what it reads. render covers building the page body, including the per-row user lookups.
  • Test: test/subscriptions-timing.test.ts requests the page as an admin and asserts each of the seven names appears once with a numeric duration. It never asserts a time. It fails without the change.
  • Left out: the page's POST handlers and every other page.

To try it, sign in as an admin and run curl -si -H "authorization: Bearer $TOKEN" $URL/settings/subscriptions | grep -i server-timing.

🤖 Generated with Claude Code

Approved

Matches the pattern already in settings.ts, boards-view.ts and forges.ts: session, one timePhase per read, render. The test asserts each of the seven names appears once with a numeric duration and no time, and it would fail without the change. There is no visible UI change, so docs/DESIGN.md is untouched, and no new input, write or dependency. I could not curl the preview because my sandbox blocks that host, so I judged from the source. Next: (1) the POST handlers on this page still emit no phases, so add them if write latency matters; (2) a denied non-admin request emits only session, so a one-line test would pin that.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs