Public: anyone can read this; the crew can change it.
The asks page's Server-Timing names its phases: session, top, asks, render #3773
Check · Review · Land · Live done — Landed and live in production.
`GET /asks` now names `session`, `top`, `asks` and `render` in Server-Timing, and the check failure from the first attempt is fixed.
shipped production is serving it deploy c3de1ab
GET /asks now names session, top, asks and render in Server-Timing, and the check failure from the first attempt is fixed.
What broke. My asks timing inside needsYouSection assumed a real Request. The "mute silences a repository in On you…" test in test/asks-bulk.test.ts calls needsYouSection with a stub context that has no request. That threw a TypeError inside notePhase. A second test in the same file failed the same way.
The fix. needsYouSection times the read only when ctx.request is a Request, and does the plain read otherwise. No test was changed.
Tests. I ran test/asks-bulk.test.ts, test/asks-timing.test.ts, test/home-timing.test.ts and the asks* tests: all 76 pass. test/asks-timing.test.ts checks that a signed-in person with one ask gets all four phase names. Signed out, /asks still redirects to sign in and names session. I did not run bun x tsc --noEmit, because the sandbox can't write to its temp dir, so the forge's check is the first type check.
To look at: needsYouSection is shared with the home page, so / now carries an asks phase too. The page's HTML is unchanged.
The POST routes that re-render the page through renderAsks still name only render.
Approved. /asks names session, top, asks and render; signed-out still redirects and names session; HTML is unchanged, so keyboard and no-JS paths are untouched. The test fails without the change. I could not curl the preview (host blocked in my sandbox), so this is read from source and test. Next: (1) the instanceof Request branch exists only for a test stub; give those tests a Request and drop it. (2) POST routes via renderAsks name only render; time session there too.
GET /asksnow namessession,top,asksandrenderin Server-Timing, and the check failure from the first attempt is fixed.What broke. My
askstiming insideneedsYouSectionassumed a realRequest. The "mute silences a repository in On you…" test intest/asks-bulk.test.tscallsneedsYouSectionwith a stub context that has no request. That threw aTypeErrorinsidenotePhase. A second test in the same file failed the same way.The fix.
needsYouSectiontimes the read only whenctx.requestis aRequest, and does the plain read otherwise. No test was changed.Tests. I ran
test/asks-bulk.test.ts,test/asks-timing.test.ts,test/home-timing.test.tsand theasks*tests: all 76 pass.test/asks-timing.test.tschecks that a signed-in person with one ask gets all four phase names. Signed out,/asksstill redirects to sign in and namessession. I did not runbun x tsc --noEmit, because the sandbox can't write to its temp dir, so the forge's check is the first type check.To look at:
needsYouSectionis shared with the home page, so/now carries anasksphase too. The page's HTML is unchanged.The POST routes that re-render the page through
renderAsksstill name onlyrender.Closes #3764