summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2023-04-13 12:41:58 +0200
committerAndrej Mihajlov <and@mullvad.net>2023-04-14 13:05:07 +0200
commit5d9a79e7706cb09fb6612419d2ad5a8243924a16 (patch)
treee0a4fa0962ad28141a3fe18bb53eb155d3f2543c
parent7198018f6bbe128c4c972a9407c0dc22be755855 (diff)
downloadmullvadvpn-5d9a79e7706cb09fb6612419d2ad5a8243924a16.tar.xz
mullvadvpn-5d9a79e7706cb09fb6612419d2ad5a8243924a16.zip
Treat cancellation errors same way as isCancelled
-rw-r--r--ios/Operations/NoFailedDependenciesCondition.swift8
1 files changed, 6 insertions, 2 deletions
diff --git a/ios/Operations/NoFailedDependenciesCondition.swift b/ios/Operations/NoFailedDependenciesCondition.swift
index 2e96a12593..81523e511d 100644
--- a/ios/Operations/NoFailedDependenciesCondition.swift
+++ b/ios/Operations/NoFailedDependenciesCondition.swift
@@ -24,11 +24,15 @@ public final class NoFailedDependenciesCondition: OperationCondition {
public func evaluate(for operation: Operation, completion: @escaping (Bool) -> Void) {
let satisfy = operation.dependencies.allSatisfy { operation in
- if let operation = operation as? AsyncOperation, operation.error != nil {
+ let operationError = (operation as? AsyncOperation)?.error
+ let isCancellationError = operationError?.isOperationCancellationError ?? false
+
+ if operationError != nil, !isCancellationError {
return false
}
- if operation.isCancelled, !self.ignoreCancellations {
+ // Treat OperationError.cancelled and isCancelled equally.
+ if operation.isCancelled || isCancellationError, !self.ignoreCancellations {
return false
}