From 11da3fce19313075720fc31a1898c254eb250e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20T=C3=B6rcsv=C3=A1ri?= Date: Sun, 2 Aug 2026 13:09:52 +0200 Subject: [PATCH] =?UTF-8?q?fix(editor):=20=3Fcollab=3D0=20is=20a=20full=20?= =?UTF-8?q?kill-switch=20=E2=80=94=20doc=20room=20+=20materialization=20in?= =?UTF-8?q?cluded?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 8/2 crash-hunt bisection attempt with ?collab=0 was silently invalid: the flag only gated the attach, while the boot fan-out joined the doc room and materialized the target file from the ydoc regardless (the "collab=0" prod log shows both, plus an attach). The flag now also skips the doc-room join — the file falls back to the plain fetch path — making it a real lever for the warm-siblings crash bisection (ydoc-vs-sexpr file source, the next suspect after sibling restage and collab attach were exonerated) and an honest user-facing escape hatch. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_019SE4o46Lnq3hF574FFq8x4 --- web/standalone/src/components/WasmTool.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/web/standalone/src/components/WasmTool.tsx b/web/standalone/src/components/WasmTool.tsx index 418507a..101bdd8 100644 --- a/web/standalone/src/components/WasmTool.tsx +++ b/web/standalone/src/components/WasmTool.tsx @@ -1581,6 +1581,15 @@ export function WasmTool({ ? (kind: string) => kind === libKind ? presyncSettled : Promise.resolve() : undefined; + // ?collab=0 is a FULL kill-switch as of 2026-08-02: it now also skips + // the doc-room join below, so the target file falls back to the plain + // fetch path instead of ydoc materialization. Before, it only gated + // the attach — which made the flag useless as a crash-hunt bisection + // lever (the 8/2 "collab=0" prod test still materialized from the + // room and even attached). + const collabOptOut = + new URLSearchParams(win.location.search).get("collab") === "0" || + new URLSearchParams(win.location.search).get("collab") === "false"; // Connect the doc's collab room in parallel with the wasm download (it // needs identity, not the wasm). Errors are captured and rethrown at // the await below — rejecting here would surface as an unhandled @@ -1589,6 +1598,10 @@ export function WasmTool({ | { session?: KicadDocSession; targetBytes?: Uint8Array } | { error: unknown } > = (async () => { + if (collabOptOut) { + append("[collab] ?collab=0 — doc room skipped, file loads from plain fetch"); + return {}; + } try { await identityReady; return await maybeConnectDocSession(win, { @@ -1612,9 +1625,6 @@ export function WasmTool({ // Never rejects: presence is best-effort, exactly as before. // Read-only viewers skip the room entirely — the server rejects their // connection anyway (presence requires write). - const collabOptOut = - new URLSearchParams(win.location.search).get("collab") === "0" || - new URLSearchParams(win.location.search).get("collab") === "false"; const crossAppReady: Promise = (tool === "pcbnew" || tool === "eeschema") && !collabOptOut && !readOnly ? (async () => {