Skip to content

fix(wsl-mover): hold an app update install while a moved project comes back - #35357

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

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

Conversation

@nwparker

@nwparker nwparker commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​117 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​112
Prod 15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​112 $\color{#cf222e}{\Huge{\mathbf{−}}}$​21 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​91

ELI5

Installing an app update quits Orca. #34813 already refuses to install while a project is moving into a WSL host. Bringing a moved project back ("Use on this computer again", or Restore) was not covered, so an Install pressed mid-way would quit Orca while it was stopping the host's copies of the project's terminals. Install now waits for that too, and says why.

What Changed

Before: while "Use on this computer again" or Restore was stopping the host's terminals and dropping the move, pressing Install quit the app straight away.

After: Install is refused until the undo returns. The update card shows "A project is coming back from its WSL host. Install the update once that finishes." with Install to retry, and the staged download is kept. Once the undo finishes, Install works as before. Both held messages (move and undo) are now localized in all 11 languages.

Mechanism:

  • releaseWslMovesHere, the shared path of "Use on this computer again" and Restore, now marks an undo as running for its whole duration, using a new beginWslMoveUndoRun() in wsl-move-running-moves.ts.
  • The updater asks one place, wslMoveInstallHold() (src/main/updater/updater-wsl-move-install-hold.ts): is a move running (the existing message), or an undo running (the new message)?
  • updater-install-execution.ts uses that, records quit_and_install_held_for_wsl_move_undo for an undo, and otherwise behaves as before.

Why

Why a separate undo mark rather than counting undo as a move. Before choosing, I checked every reader of the move registry. Counting undo as a move would change what four of them do:

  • Quit prompt (wslMove:isRunning → use-wsl-move-quit-guard): it would ask "Quit while a project is moving? The move will be undone at next launch", which is wrong for an undo.
  • Driver and orchestrator (claimWslMoveRun): a move or preview of the same distro would be refused as already_running during an undo.
  • Undo's own guard (wsl-move-use-locally's isWslMoveRunning): the undo would refuse itself as move-running.
  • Cancel (cancelWslMove): it would report cancelling an undo that ignores the signal.

isWslMoveUnderwayOnHost (the host server update hold) is unaffected either way. So undo gets its own mark and only the install path reads it.

Scope: only the user's Install (performQuitAndInstall) is held. An update that installs on its own when the app quits still installs if the user quits mid-undo. Quitting interrupts an undo either way, and undo stays out of the quit prompt for the reasons above. The hold is checked once, when Install is pressed.

The hold lasts until the undo returns. The window reload it then starts runs with window writes held, and a quit then loses nothing the undo needs.

Flag-off: undo is only reachable while WSL hosts are serving (wslHostsServing(): gate open, or saved WSL work behind a closed gate). With ORCA_INTERNAL_WSL_HOSTS unset and no saved WSL work, nothing ever begins an undo, so the install path behaves as before. The move message's text is unchanged in English.

User-risk: low. An Install pressed during an undo is refused with an explanation and works once the undo ends, typically seconds. The undo mark is released in a finally, so a failed or thrown undo can't hold updates.

Linked Issue

Follow-up to #34813, found reviewing #35345 (merged).

Visual Proof

N/A. The held message appears in the existing update card's error state. Only the text differs, and it is covered by tests.

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • updater.wsl-move-install-hold-driver.test.ts (from test(wsl-mover): prove an update install is held during a real move #35345) has a new undo case:

    • a real move runs to "moved"
    • the real releaseWslMovedProjectHere then runs, paused while it stops the host's copies
    • Install is held with the undo message and lifecycle event, and the undo isn't counted as a move
    • after the undo is released, the same staged update installs
    • With the undo mark removed, that case fails.
  • New updater-wsl-move-install-hold.test.ts:

    • nothing running → no hold
    • undo → its own message, without affecting isAnyWslMoveRunning or claimWslMoveRun
    • a move and an undo together → the move wins
    • the hold lasts until every undo ends, and each end counts once

Checks run: pnpm tc, pnpm run typecheck:ci, 57 test files (652 tests passing: every updater test, the mover IPC tests, use-locally, orchestrator, main i18n and the locale policy tests), verify-localization-catalogs, verify-localization-extraction, pnpm run check:code-quality:changed, anti-slop oxlint, oxlint, ast-grep scan, the flaky-test filter and gates.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • SSH: remote hosts aren't involved; the hold is in this desktop's install path.
  • Folder workspaces: undo of a moved folder workspace takes the same path.
  • Wire compatibility: nothing new crosses client and host.
  • Translations: hand-written. German is impersonal, matching the update card's other strings.

Status

Ready for review. Two reviewers (update/quit path).

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@nwparker

Copy link
Copy Markdown
Contributor Author

STATUS: ready. Head fb1e131, stacked on #35345 (8a57edc); I'll rebase onto main when #35345 merges. Install is held during 'Use on this computer again' / Restore through a separate undo mark, so the move registry's readers (quit prompt, driver, Cancel, undo's own guard) are unchanged. The held messages are localized in 11 locales. Checks: pnpm tc, typecheck:ci, 57 test files (652 tests passing), localization catalogs + extraction, code-quality, anti-slop, oxlint, ast-grep scan, flaky filter and gates. Reviewers: fix-reviewer, e9-reviewer.

@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 30 seconds.

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: 282dfe59-0fce-4e01-8cd4-a245e8163ce5
Commits

Reviewing files that changed from the base of the PR and between 88e23db and 144ba18.

Files selected for processing: 17
  • src/main/ipc/wsl-move-release-here.ts
  • src/main/persistence/moving-wsl-projects/wsl-move-running-moves.ts
  • src/main/updater.wsl-move-install-hold-driver.test.ts
  • src/main/updater/updater-install-execution.ts
  • src/main/updater/updater-wsl-move-install-hold.test.ts
  • src/main/updater/updater-wsl-move-install-hold.ts
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json
  • 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.

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change affects update installs during WSL project moves and returns on this desktop.

The PR still needs a fix for an undo that starts while update shutdown work is waiting.

Findings

  1. P1 Update quits during undo ▶

Summary

Holds a user-requested update install while a moved WSL project comes back.

  • Install waits while a WSL project moves or comes back.

Reviews (2) · Last reviewed commit: "fix(wsl-mover): hold an app update insta..." · Reviewed by Greptile

Comment on lines +62 to +63
const wslHold = wslMoveInstallHold()
if (wslHold) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Update quits during undo

wslMoveInstallHold() is checked only before the updater awaits its shutdown work. On Windows, that work includes store.flushPendingAsync(). A user can start “Use on this computer again” while that wait is pending: the button remains enabled, and its handler does not check whether installation has started. The updater then quits without checking the new undo run, interrupting the host-stop work this change aims to protect.

Recheck the hold before invoking the installer, or prevent new undos once installation starts. Add a test that pauses shutdown work, starts an undo, and then resumes installation.

@nwparker
nwparker force-pushed the nwparker/wsl-move-undo-install-hold branch from fb1e131 to 144ba18 Compare October 28, 2026 21:18
@nwparker

Copy link
Copy Markdown
Contributor Author

STATUS: rebased onto main 88e23db (#35345 merged as 351d05b). Head 144ba18; the commit is identical to fb1e131 (git range-diff shows '='). Checks: pnpm tc, typecheck:ci, localization catalogs + extraction, code-quality, 48 test files (521 tests passing). Not merged.

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