Repository navigation
fix(serving): browser Back no longer turns /café into /caf%C3%A9 - #367
Conversation
Astra reviewReviewed Standards[P1] Method: version the changed This contradicts ADR-0011's stable, separately versioned operation contract. Use the existing wire-version/needs-rebuild mechanism if this is an intentional breaking change, or preserve the v1 result contract. Do not ship a different result under the same version. The new SpecNo additional intent or YAGNI blockers. #324 explicitly asks for one representation across bootstrap, acknowledgements and history, and for the client to adopt the acknowledged route. The canonical acknowledgement is requested work, not speculative infrastructure; the change adds no router dependency. Checked with an isolated Chromium probe using the actual broker and client transport, with synthetic HTTP responses: Unicode set/Back reports Summary: Standards 1 blocker, the unversioned result-contract change. Spec 0 blockers. |
|
Review of the StandardsNo Effect service findings. Not breaches. Hard. ADR-0010 ( } else if (request.route) {
// Adopt the shell's canonical route, never the raw request.
const path = routeOf(value.value);
if (path !== undefined) updateRoute(path);
request.resolve(null);
}An old shell still replies Judgement. Judgement smell. Mysterious Name. The pending field SpecThe diff implements issue 324. Bootstrap, the set acknowledgement, and Back/forward report one percent-decoded path for the history entries the shell creates. (a) Missing or partialNone. The spec requires one string for the same history entry across set, Back, and hosted init: "different strings for the same history entry" and "Choose one representation and use it for initial bootstrap, set acknowledgements and browser history events."
(b) Scope creepNone. The README states the decoded contract. The wire result changed from (c) Implemented but wrongNone for the café entry. MethodOne shell read of the address is the right way to make set, Back, and reload agree. A matched pair does that. Across the deploy that wire 1 still allows, the new client is wrong.
The client ships inside the published bundle. The shell ships with the server. Old client, new shell. The client still stores the raw request and resolves New client, old shell. Decoding only in Ship this method. If the result has no string Node v24.20.0: YAGNIThis is the small fix. The shell decodes once and acknowledges that string. The client stores the acknowledgement.
The broker comment states the invariant: one decode, the same form hosted parsing uses, for bootstrap, the set acknowledgement, and back/forward. The line above
The browser test is the reproduction: a literal set, Back, a deep link, an encoded set, and the address bar staying percent-encoded. The transport edit shows the client adopt Sharing The The result chain is readable. The route case sits after the bytes branch, which a route set cannot take. SummaryStandards: 3 findings, 1 hard and 2 judgement. The worst is a new client on an old shell: Spec: 0 findings. For the history entries this shell creates, Before merge, when the acknowledgement has no string |
dc62de2 to
764f06a
Compare
|
Review follow-up, pushed as Fixed:
Kept as is:
Evidence on |
6065647 to
1839bea
Compare
The route bridge reported /café after route.set but /caf%C3%A9 after Back to
the same entry, because the client cached its raw request while popstate read
the percent-encoded location.pathname. Hosted bootstrap already decodes.
The broker now decodes the patch-relative path once for bootstrap, popstate
and set, and route.set acknowledges with the canonical { path }. The client
adopts that path instead of its raw request; route.set still resolves null.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ute by event Wire 1 promised deployed bundles a null route.set result, so the shell keeps it and sends its ordinary route event with the decoded path right after the acknowledgement. Old bundles' cached request path is corrected by that event; new clients still adopt the request on acknowledgement (so an older shell behaves as before) and skip notifying for an unchanged path, so a set reports once. Co-Authored-By: Claude Opus 5.5 <[email protected]>
764f06a to
d2929a5
Compare
…ead client (#368) Leaving a public patch and coming back with browser Back could restore a page that looked ready but whose client had already closed. Every route change then failed with `unknown_outcome` until you reloaded by hand. Fixes #341. Stacked on #367 (branch fix/324-unicode-route). The broker and client close on `pagehide`, and a back/forward-cache restore resumes that closed document without running setup again. The shell now reloads when it gets a `pageshow` with `persisted` set. That gives a fresh document and broker, and pending work is never replayed or sent over the old port. Reloading beats marking the public shell `no-store`: we keep its one-minute public cache, and `no-store` no longer reliably keeps a page out of the back/forward cache in Chromium or Safari. ADR-0010 now says this in one sentence. **Test evidence** - A new tier-1 Playwright case, "Back to a cached public patch leaves a working client", uses the browser's real back/forward cache. It runs full Chromium without Playwright's `--disable-back-forward-cache` flag, because the headless build refuses to cache. It checks that `pageshow.persisted` was true, then clicks the in-patch "Next route" button until the URL changes. - On the unfixed broker the restore is confirmed, but the clicks never move the URL off `/items/2`. - With the fix the test passes. - The Chromium tier-1 suite passes (6 of 6). Firefox couldn't run locally because its Playwright build isn't installed. - `pnpm typecheck` and `pnpm lint` pass. - `pnpm test`: 955 of 957 passed. The 2 failures were 5-second timeouts in the integrations Postgres suites, which this change doesn't touch; both files pass when run alone. Implemented by Claude Opus 5.5 via Claude Code (foreman run orchestrated by Claude Fable 5.1).
Stacked on #366 (branch fix/331-double-config).
Closes #324.
A tier 1 patch that routed to
/cafésaw/caféafterroute.set, then/caf%C3%A9after pressing Back to the same history entry, so a router matching the path showed "not found" while the URL hadn't changed (#324). The client kept its own raw request after a set. Back reported the browser's percent-encoded address. The initial load already decoded it.Now the shell decodes the patch-relative path once, the same way hosted parsing does, and reports that form for the initial load and Back/Forward.
route.setstill acknowledges withnull, as wire 1 promises. Right after the acknowledgement the shell sends its ordinaryrouteevent with the decoded path, soset("/caf%C3%A9")also settles on/café. The client still takes the requested path on acknowledgement, and it no longer notifies subscribers when a route update leaves the path unchanged, so a plain set reports once. Already-built bundles keep theirnullresult and their cached request path is corrected by the same event; there is no wire-version bump, so no stored version is sent to the needs-rebuild door.Tests:
Received: "/caf%C3%A9"after Back and passes now. The full Chromium tier 1 suite passes 5/5. Firefox wasn't run because its Playwright build isn't installed locally.clientTransport.test.tshas the shell's route event repeat an unchanged path after a set and checks that subscribers aren't notified twice. That assertion fails without the change.pnpm typecheckandpnpm lintare clean.pnpm test: 953/958 under load from parallel runs. The 5 failures were indevLifecycle.test.tsand the two Postgres integration files, none of which this PR touches, and all 17 tests in those files pass when run alone.Implemented by Claude Opus 5.5 via Claude Code (foreman run orchestrated by Claude Fable 5.1).