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

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

Merged opened this

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

Merged

`/settings/usage` now answers with a `Server-Timing` header naming `session`, `patterns`, `usage` and `render`. I merged current main (release 0.7.227) into the branch and pushed it. The type check is clean. `test/usage-timing.test.ts` and `test/server-timing-sweep.test.ts` pass (5 tests). I did not run the full suite, which the forge's check does.

shipped production is serving it deploy 4915f35

opened this

/settings/usage now answers with a Server-Timing header naming session, patterns, usage and render. I merged current main (release 0.7.227) into the branch and pushed it. The type check is clean. test/usage-timing.test.ts and test/server-timing-sweep.test.ts pass (5 tests). I did not run the full suite, which the forge's check does.

  • Phases: the page uses notePhase and timePhase from src/core/route_timing.ts, as boards-view.ts does. patterns times the list of known route patterns, usage times routeUsage, and render times building the page.
  • Order and errors: the two reads run in their original order and any error from either still propagates.
  • Unchanged: the page body, status codes and caching are the same, and nothing is computed just for the header.
  • Tests: test/usage-timing.test.ts requests the page and asserts each phase name appears with a duration. I did not run it against the old code to confirm it fails there. I also took /settings/usage off the debt list in test/server-timing-sweep.test.ts.

To try it, request /settings/usage while signed in and read the Server-Timing response header.

I left the Server-Timing header off the other settings pages.

Closes #3279

commented

/settings/usage now answers with a Server-Timing header naming session, patterns, usage and render. I merged current main (release 0.7.227) into the branch and pushed it. The type check is clean. test/usage-timing.test.ts and test/server-timing-sweep.test.ts pass (5 tests). I did not run the full suite, which the forge's check does.

  • Phases: the page uses notePhase and timePhase from src/core/route_timing.ts, as boards-view.ts does. patterns times the list of known route patterns, usage times routeUsage, and render times building the page.
  • Order and errors: the two reads run in their original order and any error from either still propagates.
  • Unchanged: the page body, status codes and caching are the same, and nothing is computed just for the header.
  • Tests: test/usage-timing.test.ts requests the page and asserts each phase name appears with a duration. I did not run it against the old code to confirm it fails there. I also took /settings/usage off the debt list in test/server-timing-sweep.test.ts.

To try it, request /settings/usage while signed in and read the Server-Timing response header.

I left the Server-Timing header off the other settings pages.

Approved — before the latest push

Approved. Follows the boards-view pattern (session, timePhase per read, render). Page body, status codes and the security floor are unchanged. The preview's signed-out 303 carries server-timing: app, session, and the tests cover the 200, 403 and 303 paths. The sweep debt entry is removed. Two things I would do next: (1) the test header cites #3413 while the sweep entry cited #3279, so point it at the issue that governs this pull; (2) the same phases for the other /settings pages still listed as unnamed (#3390), one pull each.

commented

I merged current main into the branch, resolved the one conflict, and pushed.

The conflict was in the list of pages still missing a Server-Timing header in test/server-timing-sweep.test.ts. main had dropped /signin and /signup from that list. This branch had dropped /settings/usage, which it now instruments. I kept both removals, so /signin, /signup and /settings/usage are all off the list.

test/usage-timing.test.ts and test/server-timing-sweep.test.ts pass (5 tests), and the type check is clean. I did not run the full suite, which the forge's check does.

Approved

Approved. The preview shows the signed-out redirect already carrying server-timing: app, session. The signed-in path names session, patterns, usage and render, and the tests cover the 200, 403 and 303 cases. There is no markup change, so docs/DESIGN.md is untouched, and the sweep debt entry is correctly removed. Two things I would do next: (1) fix the test header comment, which cites #3413 while the debt entry was #3279; (2) give the remaining /settings/* pages (keys, password, tokens) the same phases, tracked as #3390.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs