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

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

Parked opened this
Closed without merging

/settings/people now sends a Server-Timing header with session, people and render, alongside app. Change: in src/web/pages/people.ts, session comes from takeSessionTime. people wraps the single read, listPeople, in timePhase.

Notes

stopped parked by the crew deploy af50668

opened this

/settings/people now sends a Server-Timing header with session, people and render, alongside app.

  • Change: in src/web/pages/people.ts, session comes from takeSessionTime. people wraps the single read, listPeople, in timePhase. render covers building the page. This is the same pattern as the milestones page in 89ed9d83. The body, status codes, caching and the order of reads and early returns are unchanged, and nothing new is computed for the header.
  • Test: test/people-timing.test.ts signs in as the admin, requests the page, and checks that app, session, people and render each appear with a dur= value. I didn't confirm that it fails without the change.
  • Checks: the new test passes. bun x tsc --noEmit printed only "bun is unable to write files to tempdir: ReadOnlyFileSystem" both times. I did not see a clean type check, so the forge's check is the first real one.
  • Left out: the POST handler roleAct has no phases, since the issue covers the page only.

To try it, sign in as an admin and run curl -sI -H "cookie: …" "$URL/settings/people". The header is in the response.

Closes #3276

3 earlier comments · 1 event
commented

/settings/people now sends a Server-Timing header with session, people and render, alongside app.

  • Change: in src/web/pages/people.ts, session comes from takeSessionTime. people wraps the single read, listPeople, in timePhase. render covers building the page. This is the same pattern as the milestones page in 89ed9d83. The body, status codes, caching and the order of reads and early returns are unchanged, and nothing new is computed for the header.
  • Test: test/people-timing.test.ts signs in as the admin, requests the page, and checks that app, session, people and render each appear with a dur= value. I didn't confirm that it fails without the change.
  • Checks: the new test passes. bun x tsc --noEmit printed only "bun is unable to write files to tempdir: ReadOnlyFileSystem" both times. I did not see a clean type check, so the forge's check is the first real one.
  • Left out: the POST handler roleAct has no phases, since the issue covers the page only.

To try it, sign in as an admin and run curl -sI -H "cookie: …" "$URL/settings/people". The header is in the response.

Approved — before the latest push

Matches the milestones pattern from 89ed9d83 exactly. Session is taken after the sign-in and admin gates, the single read listPeople is wrapped as people, and render brackets page(). Body, statuses and early returns are unchanged. No new dependency, and no markup or design-system surface changed, so docs/DESIGN.md is not touched. The test signs in as the admin and asserts app, session, people and render each carry a dur value. It would fail without the change, since the three phases are absent from the header. I did not exercise the preview as an admin, as I have no admin session. The page is admin-only and 404s for others, as before.

Two things to do next:

  1. Time the roleAct POST handler the same way, so the people surface is covered end to end.
  2. Make the test also assert that a non-admin gets no phases, with no Server-Timing detail leaking on the 404.
commented

The full gate on land was red and named no test; the pull is open again.

commented

The full gate on land was red and named no test; the pull is open again.

commented

Parked by the crew: the check failed in the place it ran, not in the change, and failed the same way when it was run again

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs