diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 4759ec572..a23dffa00 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -7861,7 +7861,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COMPILE_LIB_SESSION = ""; - CURRENT_PROJECT_VERSION = 561; + CURRENT_PROJECT_VERSION = 563; ENABLE_BITCODE = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -7900,7 +7900,7 @@ HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/include/**"; IPHONEOS_DEPLOYMENT_TARGET = 15.6; LIB_SESSION_SOURCE_DIR = "${SRCROOT}/../LibSession-Util"; - MARKETING_VERSION = 2.9.1; + MARKETING_VERSION = 2.9.2; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-Werror=protocol"; OTHER_SWIFT_FLAGS = "-D DEBUG -Xfrontend -warn-long-expression-type-checking=100"; @@ -7939,7 +7939,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; COMPILE_LIB_SESSION = ""; - CURRENT_PROJECT_VERSION = 561; + CURRENT_PROJECT_VERSION = 563; ENABLE_BITCODE = NO; ENABLE_MODULE_VERIFIER = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -7974,7 +7974,7 @@ HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/include/**"; IPHONEOS_DEPLOYMENT_TARGET = 15.6; LIB_SESSION_SOURCE_DIR = "${SRCROOT}/../LibSession-Util"; - MARKETING_VERSION = 2.9.1; + MARKETING_VERSION = 2.9.2; ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-DNS_BLOCK_ASSERTIONS=1", @@ -8483,7 +8483,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COMPILE_LIB_SESSION = YES; - CURRENT_PROJECT_VERSION = 561; + CURRENT_PROJECT_VERSION = 563; ENABLE_BITCODE = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -8524,7 +8524,7 @@ ); IPHONEOS_DEPLOYMENT_TARGET = 15.6; LIB_SESSION_SOURCE_DIR = "${SRCROOT}/../LibSession-Util"; - MARKETING_VERSION = 2.9.1; + MARKETING_VERSION = 2.9.2; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "-fobjc-arc-exceptions", @@ -9151,7 +9151,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; COMPILE_LIB_SESSION = YES; - CURRENT_PROJECT_VERSION = 561; + CURRENT_PROJECT_VERSION = 563; ENABLE_BITCODE = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; @@ -9187,7 +9187,7 @@ ); IPHONEOS_DEPLOYMENT_TARGET = 15.6; LIB_SESSION_SOURCE_DIR = "${SRCROOT}/../LibSession-Util"; - MARKETING_VERSION = 2.9.1; + MARKETING_VERSION = 2.9.2; ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = ( "-DNS_BLOCK_ASSERTIONS=1", diff --git a/Session/Meta/AppDelegate.swift b/Session/Meta/AppDelegate.swift index 726e5bcd6..d9e2daf8a 100644 --- a/Session/Meta/AppDelegate.swift +++ b/Session/Meta/AppDelegate.swift @@ -322,9 +322,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD /// /// Additionally we want to ensure that our timeout timer has enough time to run so make sure we have at least `5 seconds` /// of background execution (if we don't then the process could incorrectly run longer than it should) + let remainingTime: TimeInterval = application.backgroundTimeRemaining + guard - application.backgroundTimeRemaining < TimeInterval.greatestFiniteMagnitude && - application.backgroundTimeRemaining > 5 + remainingTime != TimeInterval.nan && + remainingTime < TimeInterval.greatestFiniteMagnitude && + remainingTime > 5 else { return completionHandler(.failed) } Log.appResumedExecution() @@ -342,7 +345,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD /// /// **Note:** We **MUST** capture both `poller` and `cancellable` strongly in the event handler to ensure neither /// go out of scope until we want them to (we essentually want a retain cycle in this case) - let durationRemainingMs: Int = max(1, Int((application.backgroundTimeRemaining - 5) * 1000)) + let durationRemainingMs: Int = max(1, Int((remainingTime - 5) * 1000)) let timer: DispatchSourceTimer = DispatchSource.makeTimerSource(queue: queue) timer.schedule(deadline: .now() + .milliseconds(durationRemainingMs)) timer.setEventHandler { [poller, dependencies] in