Skip to content

fix(macOS): Fix background update check incorrectly calling Sparkle when automaticallyChecksForUpdates is NO#9744

Merged
i2h3 merged 1 commit intomasterfrom
i2h3/fix/9662-sparkle
Mar 31, 2026
Merged

fix(macOS): Fix background update check incorrectly calling Sparkle when automaticallyChecksForUpdates is NO#9744
i2h3 merged 1 commit intomasterfrom
i2h3/fix/9662-sparkle

Conversation

@i2h3
Copy link
Copy Markdown
Collaborator

@i2h3 i2h3 commented Mar 30, 2026

Fixes #9662

Problem

On macOS, Sparkle would log the following warning at startup:

"Calling -[SPUUpdater checkForUpdatesInBackground] for your own bundle when Sparkle is set to ask the user permission to check for updates in the background automatically and when automaticallyChecksForUpdates is NO leads to incorrect behavior."

This happened because backgroundCheckForUpdate() called checkForUpdatesInBackground relying solely on Nextcloud's own config (autoUpdateCheck) — without consulting Sparkle's own automaticallyChecksForUpdates property. The two settings have independent sources of truth: config.autoUpdateCheck() reads from Nextcloud's QSettings-backed config file, while automaticallyChecksForUpdates is managed by Sparkle in NSUserDefaults and reflects whether Sparkle has been initialised and granted permission by the user. They can diverge, for example on a fresh install before Sparkle has shown its first-run permission prompt.

Fix

  • Added automaticallyChecksForUpdates as a third guard in backgroundCheckForUpdate(), preventing the call to checkForUpdatesInBackground when Sparkle is not in a state to handle it.
  • Refactored the single compound if/else into individual early-return guard blocks (each with its own log message) so that logs precisely identify which condition prevented the background check from running.

…llyChecksForUpdates

Fixes #9662 - Only checkForUpdatesInBackground when automaticallyChecksForUpdates

Prevents calling -[SPUUpdater checkForUpdatesInBackground] when Sparkle's
automaticallyChecksForUpdates is NO, which caused incorrect behavior and a
Sparkle console warning (fixes #9662). Also refactors backgroundCheckForUpdate()
into guard-style early returns so each condition produces its own precise log message.

Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
@i2h3 i2h3 self-assigned this Mar 30, 2026
@i2h3 i2h3 modified the milestones: 33.0.1, 33.0.2 Mar 30, 2026
@github-project-automation github-project-automation bot moved this to 🧭 Planning evaluation (don't pick) in 💻 Desktop Clients team Mar 30, 2026
@i2h3 i2h3 added bug os: 🍎 macOS Apple macOS, formerly also known as OS X feature: 📥 install and update labels Mar 30, 2026
@i2h3 i2h3 requested a review from Copilot March 30, 2026 15:28
@i2h3
Copy link
Copy Markdown
Collaborator Author

i2h3 commented Mar 30, 2026

/backport to stable-4.0

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a macOS startup warning by preventing SPUUpdater::checkForUpdatesInBackground from being called when Sparkle itself is not configured/allowed to perform automatic background checks (automaticallyChecksForUpdates == NO), which can diverge from Nextcloud’s own config on fresh installs.

Changes:

  • Adds a Sparkle-side guard (automaticallyChecksForUpdates) before running background update checks.
  • Refactors backgroundCheckForUpdate() into early-return guards with more specific log messages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown

Artifact containing the AppImage: nextcloud-appimage-pr-9744.zip

Digest: sha256:e7d2493c37a32c88b2f9ab7735229561049bf0d27736b20e2ad774d3362665fd

To test this change/fix you can download the above artifact file, unzip it, and run it.

Please make sure to quit your existing Nextcloud app and backup your data.

@sonarqubecloud
Copy link
Copy Markdown

@i2h3 i2h3 merged commit 1269bec into master Mar 31, 2026
26 of 27 checks passed
@i2h3 i2h3 deleted the i2h3/fix/9662-sparkle branch March 31, 2026 07:44
@github-project-automation github-project-automation bot moved this from 🧭 Planning evaluation (don't pick) to ☑️ Done in 💻 Desktop Clients team Mar 31, 2026
@i2h3
Copy link
Copy Markdown
Collaborator Author

i2h3 commented Mar 31, 2026

/backport to stable-33.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug feature: 📥 install and update os: 🍎 macOS Apple macOS, formerly also known as OS X

Projects

Status: ☑️ Done

Development

Successfully merging this pull request may close these issues.

Fix Background Check for Updates

2 participants