fix(editor): ?collab=0 is a full kill-switch — doc room + materialization included
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019SE4o46Lnq3hF574FFq8x4
This commit is contained in:
parent
5c7f8a2e85
commit
11da3fce19
1 changed files with 13 additions and 3 deletions
|
|
@ -1581,6 +1581,15 @@ export function WasmTool({
|
||||||
? (kind: string) =>
|
? (kind: string) =>
|
||||||
kind === libKind ? presyncSettled : Promise.resolve()
|
kind === libKind ? presyncSettled : Promise.resolve()
|
||||||
: undefined;
|
: 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
|
// Connect the doc's collab room in parallel with the wasm download (it
|
||||||
// needs identity, not the wasm). Errors are captured and rethrown at
|
// needs identity, not the wasm). Errors are captured and rethrown at
|
||||||
// the await below — rejecting here would surface as an unhandled
|
// the await below — rejecting here would surface as an unhandled
|
||||||
|
|
@ -1589,6 +1598,10 @@ export function WasmTool({
|
||||||
| { session?: KicadDocSession; targetBytes?: Uint8Array }
|
| { session?: KicadDocSession; targetBytes?: Uint8Array }
|
||||||
| { error: unknown }
|
| { error: unknown }
|
||||||
> = (async () => {
|
> = (async () => {
|
||||||
|
if (collabOptOut) {
|
||||||
|
append("[collab] ?collab=0 — doc room skipped, file loads from plain fetch");
|
||||||
|
return {};
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
await identityReady;
|
await identityReady;
|
||||||
return await maybeConnectDocSession(win, {
|
return await maybeConnectDocSession(win, {
|
||||||
|
|
@ -1612,9 +1625,6 @@ export function WasmTool({
|
||||||
// Never rejects: presence is best-effort, exactly as before.
|
// Never rejects: presence is best-effort, exactly as before.
|
||||||
// Read-only viewers skip the room entirely — the server rejects their
|
// Read-only viewers skip the room entirely — the server rejects their
|
||||||
// connection anyway (presence requires write).
|
// 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<CrossAppHandle | undefined> =
|
const crossAppReady: Promise<CrossAppHandle | undefined> =
|
||||||
(tool === "pcbnew" || tool === "eeschema") && !collabOptOut && !readOnly
|
(tool === "pcbnew" || tool === "eeschema") && !collabOptOut && !readOnly
|
||||||
? (async () => {
|
? (async () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue