From be8247efbd8fd32952f9a6b739996b67605c7e92 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sun, 12 May 2024 14:45:22 -0700 Subject: [PATCH] Guard update timer update check against sessionInProgress (#2561) Make sure we don't perform a background update check when a user update check was initiated. This may have regressed from #2295. Also replaces an assert with an error log if the _driver already exists. Fixes #2560 --- Sparkle/SPUUpdater.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sparkle/SPUUpdater.m b/Sparkle/SPUUpdater.m index 48d8d8e8..fc119354 100644 --- a/Sparkle/SPUUpdater.m +++ b/Sparkle/SPUUpdater.m @@ -549,7 +549,11 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification - (void)updaterTimerDidFire { - [self _checkForUpdatesInBackground]; + // User can perform a checkForUpdates check around the same time the timer is ready to fire + if (!_sessionInProgress) + { + [self _checkForUpdatesInBackground]; + } } - (void)_checkForUpdatesInBackground SPU_OBJC_DIRECT @@ -695,8 +699,8 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification - (void)checkForUpdatesWithDriver:(id )d updateCheck:(SPUUpdateCheck)updateCheck installerInProgress:(BOOL)installerInProgress SPU_OBJC_DIRECT { - assert(_driver == nil); if (_driver != nil) { + SULog(SULogLevelError, @"Error: checkForUpdatesWithDriver:updateCheck:installerInProgress: called when _driver != nil"); return; }