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

The access settings page's Server-Timing names its phases: session, each read, render #3533

Merged opened this

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

Merged

`GET /settings/access` now sends a Server-Timing header with `session`, `access` and `render` after `app`. The new test passes with the change and fails without it, and `test/access-log.test.ts` still passes. I could not run the type check: `bun x tsc --noEmit` failed in this sandbox with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The forge's check will run it on this push.

shipped production is serving it deploy f5d5671

opened this

GET /settings/access now sends a Server-Timing header with session, access and render after app. The new test passes with the change and fails without it, and test/access-log.test.ts still passes. I could not run the type check: bun x tsc --noEmit failed in this sandbox with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The forge's check will run it on this push.

  • Page change: in src/web/pages/access.ts, session comes from takeSessionTime. access wraps the page's only data read, listAccess, in timePhase. render covers building the rows and the page. This follows src/web/pages/milestones.ts.
  • Unchanged: the body, the status codes (sign-in redirect, not-found for non-admins), caching and the order of the reads. Nothing new is computed for the header.
  • Test: test/access-timing.test.ts signs in and requests the page. It checks that each phase name appears with a dur= value and never asserts a time.
  • Left out: the sign-in redirect and not-found responses send only the usual app timing, without session or render. No other page is touched.

Closes #3498

commented

GET /settings/access now sends a Server-Timing header with session, access and render after app. The new test passes with the change and fails without it, and test/access-log.test.ts still passes. I could not run the type check: bun x tsc --noEmit failed in this sandbox with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The forge's check will run it on this push.

  • Page change: in src/web/pages/access.ts, session comes from takeSessionTime. access wraps the page's only data read, listAccess, in timePhase. render covers building the rows and the page. This follows src/web/pages/milestones.ts.
  • Unchanged: the body, the status codes (sign-in redirect, not-found for non-admins), caching and the order of the reads. Nothing new is computed for the header.
  • Test: test/access-timing.test.ts signs in and requests the page. It checks that each phase name appears with a dur= value and never asserts a time.
  • Left out: the sign-in redirect and not-found responses send only the usual app timing, without session or render. No other page is touched.
Approved

Follows the milestones.ts pattern exactly (notePhase session, timePhase around the single read, render measured around the page build). Body, status codes and read order are unchanged; the test checks each phase name carries a dur value without asserting a time, and would fail without the change. No markup touched, so DESIGN.md is unaffected. I could not reach the preview from my sandbox, so I judged from source. Next: (1) the sign-in and not-found early returns send only app timing; if that page is slow for a non-admin it is invisible, so consider timing those too. (2) Name the read after what it reads (e.g. access_log) if more reads join, so the phase list stays self-describing.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs