From 50942909f2aa57a122fd81b83db2ec5b349e66a1 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sun, 25 Apr 2021 12:24:34 -0700 Subject: [PATCH] Add comment indicating why we don't pass full downloaded path --- Downloader/SPUDownloader.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Downloader/SPUDownloader.m b/Downloader/SPUDownloader.m index 05e3518b..59126a30 100644 --- a/Downloader/SPUDownloader.m +++ b/Downloader/SPUDownloader.m @@ -118,6 +118,10 @@ static NSString *SUDownloadingReason = @"Downloading update related file"; - (void)removeDownloadDirectory:(NSString *)directoryName bundleIdentifier:(NSString *)bundleIdentifier { + // Only take the directory name and compute most of the base path ourselves + // This way we do not have to send/trust an absolute path + // The downloader instance that creates this temp directory isn't necessarily the same as the one + // that clears it (eg upon skipping an already downloaded update), so we can't just preserve it here too dispatch_async(dispatch_get_main_queue(), ^{ NSString *rootPersistentDownloadCachePath = [self rootPersistentDownloadCachePathForBundleIdentifier:bundleIdentifier]; if (rootPersistentDownloadCachePath != nil) {