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

/verify, /recover and /claim name their Server-Timing phases and answer under 50 ms #4324

opened this

Merged 45d 21h ago, live in production

/verify, /recover and /claim now name their Server-Timing phases, and all three have left UNNAMED in test/server-timing-sweep.test.ts. bun x tsc --noEmit is clean, and the sweep and the new test pass. I didn't run the full bun test.

Notes

opened this

/verify, /recover and /claim now name their Server-Timing phases, and all three have left UNNAMED in test/server-timing-sweep.test.ts. bun x tsc --noEmit is clean, and the sweep and the new test pass. I didn't run the full bun test.

The phases each route names, besides app:

  • /verify (src/web/pages/site.ts): session, verify (the verifyEmail read) and render.
  • /recover (src/web/pages/passkeys.ts): session, render, and link (the recoveryAccount lookup) when ?token= is given.
  • /claim (src/web/pages/claim.ts): session, spawned, owners and render. This route already named most of them. The only gap was a forge that wasn't spawned, whose "not a claim link" page skipped render, so I wrapped that path in render.

The new test/verify-timing.test.ts signs in, then checks /verify?token=, /recover, /recover?token= and /claim. For each it checks the phase names and that app is under 50 ms warm. It also checks that the phases add up to no more than app plus 1 ms.

The response has no total entry, only app, so I compared the phases against app. I did not check that they come within 1 ms below it.

I did no byte-for-byte comparison of the HTML. The changes only wrap the existing page() calls in timePhase.

Ways to try it: run bun test test/verify-timing.test.ts test/server-timing-sweep.test.ts, or curl -sI any of those paths on the preview and read server-timing.

Closes #4317

2 earlier comments
commented

/verify, /recover and /claim now name their Server-Timing phases, and all three have left UNNAMED in test/server-timing-sweep.test.ts. bun x tsc --noEmit is clean, and the sweep and the new test pass. I didn't run the full bun test.

The phases each route names, besides app:

  • /verify (src/web/pages/site.ts): session, verify (the verifyEmail read) and render.
  • /recover (src/web/pages/passkeys.ts): session, render, and link (the recoveryAccount lookup) when ?token= is given.
  • /claim (src/web/pages/claim.ts): session, spawned, owners and render. This route already named most of them. The only gap was a forge that wasn't spawned, whose "not a claim link" page skipped render, so I wrapped that path in render.

The new test/verify-timing.test.ts signs in, then checks /verify?token=, /recover, /recover?token= and /claim. For each it checks the phase names and that app is under 50 ms warm. It also checks that the phases add up to no more than app plus 1 ms.

The response has no total entry, only app, so I compared the phases against app. I did not check that they come within 1 ms below it.

I did no byte-for-byte comparison of the HTML. The changes only wrap the existing page() calls in timePhase.

Ways to try it: run bun test test/verify-timing.test.ts test/server-timing-sweep.test.ts, or curl -sI any of those paths on the preview and read server-timing.

commented

I merged main into the branch and pushed it. The only conflict was in test/server-timing-sweep.test.ts.

  • The conflict: both sides had edited the list of pages whose Server-Timing phases are still unnamed. My branch had /board in that list and main had /claim.
  • The resolution: I dropped both entries. main had already removed /board. /claim stays out because this pull names its phases, as it does for /verify and /recover.
  • What I ran: bun x tsc --noEmit is clean and test/server-timing-sweep.test.ts passes. I started the full bun test but it passed the 10-minute limit, so I didn't wait for it. The forge's check will run the whole suite on this push.
commented

I merged main into the branch again and pushed it. The conflict was again only in test/server-timing-sweep.test.ts, in the list of pages whose Server-Timing phases are still unnamed.

  • Resolution: main had since named the phases for /alice/forge/toolbar, /apps/open, /organizations/new and the /settings/* pages, so I took those removals. main still listed /claim and /recover, but this pull names their phases, so I removed them too. What remains in the list is /live/apps, /live/on-you, /signin/parent and /signin/parent/callback.
  • What I ran: bun x tsc --noEmit is clean and test/server-timing-sweep.test.ts passes. I didn't run the full bun test, because it passed the 10-minute limit last time. The forge's check will run it on this push.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs