From af245bfe623c3c485cb5ed0f1245886f52d4af33 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 1 May 2021 11:08:18 -0700 Subject: [PATCH] Enforce the updater session is in progress We should enforce update session is in progress before checking for new updates. I've tested checking for updates regularly, in background, and informational updates. An update check could have been made while the permission request was in flight, which we don't want to happen. --- Sparkle/SPUUpdater.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sparkle/SPUUpdater.m b/Sparkle/SPUUpdater.m index 933da125..206776e4 100644 --- a/Sparkle/SPUUpdater.m +++ b/Sparkle/SPUUpdater.m @@ -423,6 +423,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification if (self.sessionInProgress) { SULog(SULogLevelError, @"Error: -checkForUpdatesInBackground called but .sessionInProgress == YES"); + return; } self.sessionInProgress = YES; @@ -488,6 +489,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification if (self.sessionInProgress) { SULog(SULogLevelError, @"Error: -checkForUpdates called but .sessionInProgress == YES"); + return; } if (self.driver != nil) { @@ -529,6 +531,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification if (self.sessionInProgress) { SULog(SULogLevelError, @"Error: -checkForUpdateInformation called but .sessionInProgress == YES"); + return; } self.sessionInProgress = YES;