Skip to content

fix(wsl-mover): hold an app update install while a WSL project move runs - #34813

Merged
nwparker merged 1 commit into
mainfrom
nwparker/wsl-move-update-install-hold
Oct 28, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/wsl-move-update-install-hold

Conversation

@nwparker

@nwparker nwparker commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​138 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​138
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​23 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​23

ELI5

Moving a project to a WSL host takes a while. If Orca installs an app update in the middle, the update quits the app and the move is cut off. Orca recovers safely on the next launch, so nothing is lost, but the move fails, and in one narrow window the projects stay read-only until the user starts the move again. Now, while a move is running, Orca holds the update install and says why. The move finishes, and the user installs the update afterwards.

What Changed

  • Before: clicking Install (or an auto-install) during a move quit the app immediately. The updater never checked for a move.
  • After (only while this app is running a WSL move, which needs the internal WSL hosts gate): Install refuses with "A project is moving to its WSL host. Install the update once the move finishes." The staged update keeps its Install retry, and the move and its terminals keep running. Once the move ends, Install works as before.
  • How:
    • isAnyWslMoveRunning() in wsl-move-running-moves.ts (the per-process move registry) is true from the moment a move claims its distro through the desktop rewrite.
    • performQuitAndInstall checks it right after the Linux package checks and before anything is torn down. It uses the same abort-and-status path as the Linux package refusal: updater:quitAndInstallAborted plus an error status with retryAction: 'install'.

Why

I audited quit, crash and update-install at every step of a move on this branch. Every step comes back on the next launch either fully moved or back at zero; none loses data:

Move step What the journal holds Next launch
preparing nothing nothing to do
pausing terminals prepared / source-fenced / quiesced reset to zero; panes stay slept and restorable; a host abort is owed
copying destination-staged reset; the owed abort is sent on next contact
copying → switching blobs-transferred (commit may have been sent) stays fenced (read-only) until a move start settles it, forward or back (wsl-move-reset.ts:96-98, wsl-move-driver-plan.ts:74-105)
finishing destination-committed → client-rewritten the desktop rewrite finishes forward at startup

The existing kill-rig fault-injection test kills at more than 30 points of a clean move, with and without a host server restart, and pins these outcomes.

So the cost of an install mid-move is availability, not data: a failed move, and in the blobs-transferred window, read-only projects. The automatic mover's step previews first, and the preview refuses an in-flight move, so the user has to start the move from the dialog. Holding the install is the smallest guard that avoids all of it. It applies only while a move actually runs in this process, so there is nothing to time out or get stuck: the run always ends by finishing, failing or being cancelled.

Alternatives considered:

  • Cancelling the move to let the install proceed: a move can only be cancelled before it asks the host to commit, so it wouldn't cover the risky window.
  • Failing the pre-quit cleanup hook: that surfaces as a generic "quit and reopen Orca" message, which is the wrong advice mid-move.

Linked Issue

N/A (internal).

Visual Proof

N/A: an updater status message shown only during an internal, gated flow. The message text is asserted in the test.

Testing

  • src/main/updater.wsl-move-install-hold.test.ts:

    • with a move claimed, Install doesn't quit, doesn't release terminals, shows the message with an Install retry, and records quit_and_install_held_for_wsl_move;
    • after the move is released, Install proceeds.

    The first test fails with the check removed.

  • pnpm tc, check:code-quality:changed, the existing updater suites (35 files) and the import, test-runner and max-lines checks pass locally. The full lint and test suites run in CI.

Review

Self-reviewed.

Agent skill upstream boundary

  • Not applicable.

Notes

  • Follow-ups found in the audit (not in this PR):
    • A WSL orcad update during a move isn't held. Settings Update/Force can redeploy the destination host's server mid-move (wsl-orcad-deploy.ts, no move check). This is safe (the move resets or waits), but it costs the move. A one-line hold before deployOrcad when isWslMoveRunning(distro), mirroring the SSH "migrating" skip, would cover it.
    • The automatic mover never settles an interrupted commit. After a crash or install in the blobs-transferred window, the orchestrator's preview is refused as already in flight and retried forever, without starting the move that would settle it. The projects stay read-only until the user starts the move in the dialog.
    • A plain quit (or install-on-quit) mid-move still isn't warned about. It recovers the same safe way.
  • SSH, paired hosts and the gate-off path are untouched: no move can run without the gate.

Installing an update quits the app. A move interrupted that way recovers on the next launch with
nothing lost, but the user sees the move fail and, if it stopped between sending the copy and the
host's commit, the projects stay read-only until a move is started again. The install now refuses
while this process runs a move, says why, and keeps the staged update's Install retry; the move
and its terminals carry on. Moves only run behind the internal WSL hosts gate, so nothing changes
with the gate off.
@nwparker
nwparker force-pushed the nwparker/wsl-move-update-install-hold branch from d177cf5 to 7f626e3 Compare October 28, 2026 07:18
@nwparker
nwparker changed the base branch from nwparker/wsl-mover-land-2 to main October 28, 2026 07:18
@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 40496d57-7a02-40f8-88c3-9260efcc5b07
Commits

Reviewing files that changed from the base of the PR and between 7cdfebd and 7f626e3.

Files selected for processing: 3
  • src/main/persistence/moving-wsl-projects/wsl-move-running-moves.ts
  • src/main/updater.wsl-move-install-hold.test.ts
  • src/main/updater/updater-install-execution.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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