From 99319929128ca03f4acd4951ae64061a2236842e Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 20 Feb 2021 21:09:57 -0800 Subject: [PATCH] Provide URL to troubleshoot XPC timed out issues --- Sparkle/SPUProbeInstallStatus.m | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Sparkle/SPUProbeInstallStatus.m b/Sparkle/SPUProbeInstallStatus.m index 71225bb5..d44aac2d 100644 --- a/Sparkle/SPUProbeInstallStatus.m +++ b/Sparkle/SPUProbeInstallStatus.m @@ -27,7 +27,8 @@ + (void)probeInstallerInProgressForHostBundleIdentifier:(NSString *)hostBundleIdentifier completion:(void (^)(BOOL))completionHandler { id installerStatus = nil; - if (!SPUXPCServiceExists(@INSTALLER_STATUS_BUNDLE_ID)) { + BOOL usesXPC = SPUXPCServiceExists(@INSTALLER_STATUS_BUNDLE_ID); + if (!usesXPC) { installerStatus = [[SUInstallerStatus alloc] init]; } else { installerStatus = [[SUXPCInstallerStatus alloc] init]; @@ -59,7 +60,11 @@ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(PROBE_TIMEOUT * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ if (!handledCompletion) { - SULog(SULogLevelError, @"Timed out while probing installer progress"); + if (usesXPC) { + SULog(SULogLevelError, @"Timed out while probing installer progress. Please see https://sparkle-project.org/documentation/sandboxing/#testing for potential cause."); + } else { + SULog(SULogLevelError, @"Timed out while probing installer progress"); + } completionHandler(NO); handledCompletion = YES; } @@ -70,7 +75,8 @@ + (void)probeInstallerUpdateItemForHostBundleIdentifier:(NSString *)hostBundleIdentifier completion:(void (^)(SPUInstallationInfo * _Nullable))completionHandler { id installerStatus = nil; - if (!SPUXPCServiceExists(@INSTALLER_STATUS_BUNDLE_ID)) { + BOOL usesXPC = SPUXPCServiceExists(@INSTALLER_STATUS_BUNDLE_ID); + if (!usesXPC) { installerStatus = [[SUInstallerStatus alloc] init]; } else { installerStatus = [[SUXPCInstallerStatus alloc] init]; @@ -108,7 +114,11 @@ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(PROBE_TIMEOUT * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ if (!handledCompletion) { - SULog(SULogLevelDefault, @"Timed out while probing installer info data"); + if (usesXPC) { + SULog(SULogLevelDefault, @"Timed out while probing installer info data. Please see https://sparkle-project.org/documentation/sandboxing/#testing for potential cause."); + } else { + SULog(SULogLevelDefault, @"Timed out while probing installer info data"); + } completionHandler(nil); handledCompletion = YES; }