Skip to content

Cancelling the privileged-install auth prompt (or a transient SMJobSubmit failure) breaks auto-update until app restart #315

@MarshallOfSound

Description

@MarshallOfSound

Symptom

After the privileged-install authorization prompt is cancelled once, every subsequent update check fails with the same error and the user is never re-prompted. The app re-downloads and re-verifies the update on each check, then fails. Only fix is restarting the app.

In Electron apps this surfaces as autoUpdater firing 'error' on every check with:

Error Domain=NSOSStatusErrorDomain Code=-60006
"errAuthorizationCanceled: The authorization was cancelled by the user."

The same thing happens for a transient SMJobSubmit failure (no user action needed).

Precondition

The auth prompt only appears when the bundle or its parent dir isn't writable by the current user — non-admin users, root-owned bundles from pkg/MDM installs, etc. Admin drag-installs don't hit it.

Cause

_shipItLauncher (SQRLUpdater.m) wraps +[SQRLShipItLauncher launchPrivileged:] in replayLazily. RACReplaySubject buffers the terminal event and RACMulticastConnection.connect is CAS-guarded to never re-subscribe the source, so the first error is replayed to every future subscriber for the lifetime of the SQRLUpdater.

Per-check waste

checkForUpdatesCommand
  → download zip
  → unarchive + codesign verify
  → prepareUpdateForInstallation (writes ShipItState.plist)
  → self.shipItLauncher          ← replays cached error instantly
  → doError: cleanUp()           ← deletes the staged update

Full download + verify cost on every interval, never installs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions