Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

fix(spaces-macos): install a downloaded update when the app quits (CUA-3065) (#6281)

Francesco Bonacci964e3f62847b
diff --git a/.github/workflows/ci-cua-spaces-macos.yml b/.github/workflows/ci-cua-spaces-macos.yml
index 6043b8dedb..677dd00243 100644
--- a/.github/workflows/ci-cua-spaces-macos.yml
+++ b/.github/workflows/ci-cua-spaces-macos.yml
@@ -131,7 +131,9 @@ jobs:
if: ${{ (github.event_name != 'pull_request' || !github.event.pull_request.draft) && (!startsWith(github.head_ref, 'release-please--branches--')) }}
name: Cua Spaces app library (built once)
runs-on: macos-26
- timeout-minutes: 45
+ # A cold build takes 20 to 60+ minutes (a push to main ran 73 minutes). 45
+ # cancelled steady progress on PRs that miss main's cached library.
+ timeout-minutes: 90
env:
CARGO_BUILD_JOBS: 4
# The slice cache key names the repository (same value as the producer).
diff --git a/apps/cua-spaces-macos/README.md b/apps/cua-spaces-macos/README.md
index 786e098051..4117972d28 100644
--- a/apps/cua-spaces-macos/README.md
+++ b/apps/cua-spaces-macos/README.md
@@ -526,7 +526,7 @@ update found by a scheduled check downloads and extracts at once; Sparkle's
ready-to-install reply is then held, and nothing restarts the app until the
page calls `update.install` ("Restart to update"). With "check for and
download updates automatically" on (the default), Sparkle's silent path reaches the same state through
-`updater(_:willInstallUpdateOnQuit:immediateInstallationBlock:)`. The page
+`updater(_:willInstallUpdateOnQuit:immediateInstallationBlock:)`, which returns false so Sparkle also installs the downloaded update when the app quits. The page
reads the state with `update.get` (`{status, currentVersion, version,
percent, notesUrl, message}`; status is `idle`, `checking`, `available`,
`downloading`, `downloaded` or `error`) and refetches on the `update.changed`
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/UpdatesModel.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/UpdatesModel.swift
index 081cec4c49..173043c7eb 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/UpdatesModel.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/UpdatesModel.swift
@@ -166,14 +166,18 @@ public final class SparkleUpdater: NSObject, UpdaterDriving, SPUUpdaterDelegate
}
public nonisolated func updaterDidNotFindUpdate(_ updater: SPUUpdater) { tell("not_found") }
- /// The silent path (`automaticallyDownloadsUpdates`): Sparkle never asks
- /// the user driver, and installs on quit. Taking the install here makes
- /// that update "downloaded" too, with the immediate install as Restart.
+ /// The silent path (`automaticallyDownloadsUpdates`): the update is
+ /// downloaded and the page offers "Restart to update" through
+ /// `immediateInstallHandler`. Returning false leaves Sparkle in charge of
+ /// the install, so the update is also applied when the app quits. Returning
+ /// true would promise that the app installs it, and only the click does:
+ /// users who never click (the app lives in the menu bar and notch) stayed
+ /// on the old version for ever (CUA-3065).
public nonisolated func updater(_ updater: SPUUpdater, willInstallUpdateOnQuit item: SUAppcastItem,
immediateInstallationBlock immediateInstallHandler: @escaping () -> Void) -> Bool {
let version = item.displayVersionString
MainActor.assumeIsolated { driver.silentlyDownloaded(version: version, install: immediateInstallHandler) }
- return true
+ return false
}
/// A cycle that ended with nothing to show clears a pending "checking".