From b2ccd24172564c35a174a6a979190ccc4b3172dc Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Mon, 21 Oct 2024 12:26:21 +1100 Subject: [PATCH] Fixed an app submission issue due to private API naming collision --- Session.xcodeproj/project.pbxproj | 4 ++-- SessionUtilitiesKit/General/LRUCache.swift | 10 ++++------ .../Networking/ProxiedContentDownloader.swift | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index e84f3f1a7..237522c9c 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -7636,7 +7636,7 @@ CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 494; + CURRENT_PROJECT_VERSION = 495; ENABLE_BITCODE = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -7715,7 +7715,7 @@ CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 494; + CURRENT_PROJECT_VERSION = 495; ENABLE_BITCODE = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; diff --git a/SessionUtilitiesKit/General/LRUCache.swift b/SessionUtilitiesKit/General/LRUCache.swift index 35b455176..04bbcd0ab 100644 --- a/SessionUtilitiesKit/General/LRUCache.swift +++ b/SessionUtilitiesKit/General/LRUCache.swift @@ -9,11 +9,10 @@ public class LRUCache { private var cacheMap: [KeyType: ValueType] = [:] private var cacheOrder: [KeyType] = [] - private let maxSize: Int + private let maxCacheSize: Int - @objc - public init(maxSize: Int) { - self.maxSize = maxSize + public init(maxCacheSize: Int) { + self.maxCacheSize = maxCacheSize NotificationCenter.default.addObserver(self, selector: #selector(didReceiveMemoryWarning), @@ -59,7 +58,7 @@ public class LRUCache { updateCacheOrder(key: key) - while cacheOrder.count > maxSize { + while cacheOrder.count > maxCacheSize { guard let staleKey = cacheOrder.first else { return } @@ -68,7 +67,6 @@ public class LRUCache { } } - @objc public func clear() { cacheMap.removeAll() cacheOrder.removeAll() diff --git a/SessionUtilitiesKit/Networking/ProxiedContentDownloader.swift b/SessionUtilitiesKit/Networking/ProxiedContentDownloader.swift index 87ebd2330..49c04fee0 100644 --- a/SessionUtilitiesKit/Networking/ProxiedContentDownloader.swift +++ b/SessionUtilitiesKit/Networking/ProxiedContentDownloader.swift @@ -463,7 +463,7 @@ open class ProxiedContentDownloader: NSObject, URLSessionTaskDelegate, URLSessio // evacuated from the cache; if a cache consumer (e.g. view) is // still using the asset, the asset won't be deleted on disk until // it is no longer in use. - private var assetMap = LRUCache(maxSize: 100) + private var assetMap = LRUCache(maxCacheSize: 100) // TODO: We could use a proper queue, e.g. implemented with a linked // list. private var assetRequestQueue = [ProxiedContentAssetRequest]()