Skip to content

Join WSL cookie copies already running when the rewrite retries - #35463

Closed
OrcaWin wants to merge 1 commit into
mainfrom
OrcaWin/wsl-cookie-copy-retry-ownership
Closed

OrcaWin wants to merge 1 commit into
mainfrom
OrcaWin/wsl-cookie-copy-retry-ownership

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​352 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​352
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​11 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​10

LoC: +363/-1

Join an existing cookie-copy promise when a WSL desktop rewrite retries the same migration. A store timeout leaves the copy running; starting another copy opens an extra hidden source target and retains another complete cookie snapshot while waiting for the destination lock. Remove the pending entry on success or failure so later recovery and independent migrations keep working.

Validation: 61 focused tests, 49 related tests, Node/web/CLI typechecks, nine quality groups, 17 selected verifiers and unchanged normal precommit hooks pass. Related tests explicitly skip 25 mobile bundling/notebook cases. Exact old source fails only two target-count checks; four controls pass. Actual hidden Electron comparisons at 100/1000 cookies reduce windows 5/17 to 2 and full snapshots 4/16 to 1. Both variants eventually drain to zero, write each cookie once and recover the ledger. Native CDP replies are delayed by 9,000 virtual milliseconds under a controlled timer; this is not measured native latency. Root verified 100 sealed files, 227 git inputs plus six named unused-provider stubs and one entry per native bundle, exact patch/bundle, and four relevant sources unchanged through main552691fa.

The full aggregate wrapper is queued after #35461; bootstrap and ABI-repair preflights were omitted from direct checks under the existing no-install/no-repair constraint. No aggregate pass or Claude takeover claimed. No permanent-leak, CPU/RSS, real WSL relocation, macOS/Windows or full UI claim. Local ownership changes no journal, remote/mobile protocol, path or workspace assumptions. Existing installed dependencies were reused; the donor's earlier dependency incident is disclosed without a pristine-provenance claim.

Frozen head b387fbf8b075f41a3c950da8fb012a93f402a0d3, base 50182418667d99313fab4ff18efde230b08b79f3. Report and preserved attempts: /home/neil/.local/state/orca-electron-audit/wsl-cookie-copy-retry-ownership/implementation-report.md.

@OrcaWin

OrcaWin commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for this. We're closing it. WSL project moves only run behind the internal WSL gate, and the duplicate copy only happens when a cookie copy runs past the 30s store timeout, which the PR reproduces only with synthetic 9s-per-cookie CDP delays. Even then the current code drains and finishes correctly; it just keeps a few extra windows and cookie snapshots alive for a while. A 352-line mocked fake-timer test for a 10-line change, plus a retry that could silently reuse a stale context, doesn't clear our bar.

Closing per maintainer triage (low-risk / zero user trade-off / material-gain bar).

@OrcaWin OrcaWin closed this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant