Skip to content

Fix macOS updater restart loop - #299

Merged
milind-soni merged 1 commit into
mainfrom
codex/fix-macos-updater
Aug 20, 2026
Merged

Fix macOS updater restart loop#299
milind-soni merged 1 commit into
mainfrom
codex/fix-macos-updater

Conversation

@milind-soni

@milind-soni milind-soni commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • stage macOS updates through Squirrel before presenting Restart
  • surface native updater errors and prevent the UI from spinning indefinitely
  • add a bounded install timeout and private updater diagnostics
  • cover staging, asynchronous errors, and synchronous install failures with tests

Verification

  • pnpm test (1327 passed, 12 skipped)
  • pnpm test:updater (15 passed)
  • pnpm typecheck
  • pnpm check:electron
  • changed-file Oxlint

Summary by CodeRabbit

  • New Features

    • Added support for installing updates through the updater flow.
    • Added updater activity logging to help monitor update operations.
    • macOS updates can now install automatically when the app quits.
  • Bug Fixes

    • Improved handling of download and installation failures.
    • Prevented duplicate error notifications and incorrect download status updates.
    • Added timeout handling for stalled installations.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1e5edab5-70df-4cff-94bd-d762d8d3e8d4

📥 Commits

Reviewing files that changed from the base of the PR and between 6b2ca7e and cd709a8.

📒 Files selected for processing (3)
  • electron/updater-coordinator.mjs
  • electron/updater-coordinator.node-test.mjs
  • electron/updater.mjs

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The updater coordinator now manages download and install operation states, centralizes updater error handling, and exposes install(). The updater adds persistent logging, delegates installation to the coordinator, and enables automatic installation on macOS.

Changes

Updater lifecycle

Layer / File(s) Summary
Operation error and download coordination
electron/updater-coordinator.mjs
The coordinator centralizes updater error handling, records failed operations, prevents duplicate errors, and delays downloaded state until downloadUpdate() resolves.
Install lifecycle and validation
electron/updater-coordinator.mjs, electron/updater-coordinator.node-test.mjs
The coordinator exposes install(), tracks installation, handles synchronous and asynchronous failures, and reports timeout failures. Tests cover download staging and install errors.
Updater integration and persistent logging
electron/updater.mjs
The updater delegates installation to the coordinator, configures platform-specific automatic installation, and writes protected persistent logs while swallowing logging failures.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to cd709

The PR stages macOS updates before restart, surfaces updater failures, and bounds installation time to prevent indefinite UI spinning; no actionable merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant IPCHandler
  participant updaterCoordinator
  participant autoUpdater
  IPCHandler->>updaterCoordinator: install()
  updaterCoordinator->>autoUpdater: quitAndInstall()
  autoUpdater-->>updaterCoordinator: installation error
  updaterCoordinator-->>IPCHandler: error state
Loading

Possibly related PRs

Suggested reviewers: aivsomkar, bferanmi806-sketch

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: fixing the macOS updater restart loop.
Description check ✅ Passed The description explains the main changes and verification results; the missing template headings are non-critical.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-macos-updater

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

@milind-soni
milind-soni merged commit dfa8c68 into main Aug 20, 2026
6 checks passed
@milind-soni milind-soni mentioned this pull request Aug 20, 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