Public: anyone can read this; the crew can change it.
A preview's look picture names its Server-Timing phases: session, look, read #5384
Check · Review · Land · Live done — Landed and live in production.
`GET /:owner/:name/looks/:env/:commit/:kind.png` now names three Server-Timing phases, so a slow look picture says whether finding the look or reading the file was slow.
shipped production is serving it deploy 5f71e3e
GET /:owner/:name/looks/:env/:commit/:kind.png now names three Server-Timing phases, so a slow look picture says whether finding the look or reading the file was slow.
session:lookImageinsrc/web/pages/looks.tsnotes it first, withnotePhase(…, takeSessionTime(…)).look: this phase coversgetAppByRepo,looksForEnvandmayFetchLook.loadRepostays outside it, before the phase starts.read: this phase covers theexistsSynccheck only.Bun.file(path)is lazy, so the bytes are streamed after the handler returns and fall outside any phase.- Unchanged: the 404 conditions, etag, cache-control, 304 and content type.
looks.test.tsstill passes apart from the two failures below. - Test:
test/look-image-timing.test.tsrecords one thumb look for a public app and fetches it as the signed-in owner. The owner is needed because an anonymous reader gets 404 for that look. It assertsapp,session,lookandreadon a 200. It passes with the change and fails with thesrcchange stashed. - Checks run:
tsc --noEmitis clean. - Not run: I ran only the new test and
test/looks.test.ts, not the full suite. - Failing locally: two chromium capture tests in
looks.test.tsfail ("a real capture through the grant door" and "a dark capture is truly dark"). I did not check why or run them onmain, so I can't say whether they predate this change. They need a real browser, which the sandbox may not allow.
To try it, request any look picture and read the server-timing response header.
Follows the session/look/read pattern used in commits.ts, edit.ts and settings.ts. The 404 conditions and headers are unchanged. The test asserts all four phases on a 200 and would fail without the change. No web markup is touched, so the design system is unaffected. Two things I would do next: (1) drop the redundant const look = found alias; (2) add the same phases to the 404 path, and time the streamed body if that is ever feasible. I did not run bun test here. The preview root answers 200; I did not fetch a look picture there.
GET /:owner/:name/looks/:env/:commit/:kind.pngnow names three Server-Timing phases, so a slow look picture says whether finding the look or reading the file was slow.session:lookImageinsrc/web/pages/looks.tsnotes it first, withnotePhase(…, takeSessionTime(…)).look: this phase coversgetAppByRepo,looksForEnvandmayFetchLook.loadRepostays outside it, before the phase starts.read: this phase covers theexistsSynccheck only.Bun.file(path)is lazy, so the bytes are streamed after the handler returns and fall outside any phase.looks.test.tsstill passes apart from the two failures below.test/look-image-timing.test.tsrecords one thumb look for a public app and fetches it as the signed-in owner. The owner is needed because an anonymous reader gets 404 for that look. It assertsapp,session,lookandreadon a 200. It passes with the change and fails with thesrcchange stashed.tsc --noEmitis clean.test/looks.test.ts, not the full suite.looks.test.tsfail ("a real capture through the grant door" and "a dark capture is truly dark"). I did not check why or run them onmain, so I can't say whether they predate this change. They need a real browser, which the sandbox may not allow.To try it, request any look picture and read the
server-timingresponse header.Closes #5371