From 114ff4b4eb6a0bbcc7088a084ae1a9a4d8ae312e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 24 Sep 2026 10:57:45 +0200 Subject: [PATCH] test(sharing): read loadDocument as a headerless navigation sink The connect and sign-in hand-offs moved from window.location writes onto the loadDocument helper, and the guard stopped seeing them. Its reference floor caught the drop. Watched red with a fenced thumbnail route handed to loadDocument. --- .../record-fence-headerless-transport-guard.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/__tests__/record-fence-headerless-transport-guard.test.ts b/src/__tests__/record-fence-headerless-transport-guard.test.ts index 3ccd9731d..a1dc68677 100644 --- a/src/__tests__/record-fence-headerless-transport-guard.test.ts +++ b/src/__tests__/record-fence-headerless-transport-guard.test.ts @@ -235,6 +235,13 @@ function headerlessReferences(file: string, source: string): Reference[] { )) { record(m.index, "window.location", m[1] ?? m[2] ?? ""); } + // `loadDocument(path)` (`src/lib/navigation/load-document.ts`) is a + // `window.location.assign` behind a name, so it is the same sink. Without + // this the connect and sign-in hand-offs that moved onto it would drop out + // of view while the guard kept passing. + for (const m of source.matchAll(/\bloadDocument\(\s*([^)\n]+)\)/g)) { + record(m.index, "loadDocument", m[1]); + } // The imperative form: `el.src = "/api/…"`. A JSX attribute is the common // shape and the one the real offenders had, but a script or image built in // an effect issues exactly the same headerless request — and the tree