Always signal enumerator after errors to try and recover from what the error might...
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Tue, 16 Apr 2024 13:27:47 +0000 (21:27 +0800)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Wed, 17 Apr 2024 08:44:12 +0000 (08:44 +0000)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension.swift

index 950f9b9b4b67d98893727e7c9495c27f98a4aae0..1ee6476a3d7e2412d64a0b1b2ec32c91f274763e 100644 (file)
@@ -202,6 +202,9 @@ import OSLog
                 ncAccount: ncAccount,
                 progress: progress
             )
+            if error != nil {
+                signalEnumerator(completionHandler: { _ in })
+            }
             completionHandler(
                 item ?? itemTemplate,
                 NSFileProviderItemFields(),
@@ -264,6 +267,9 @@ import OSLog
                 domain: domain,
                 progress: progress
             )
+            if error != nil {
+                signalEnumerator(completionHandler: { _ in })
+            }
             completionHandler(modifiedItem ?? item, [], false, error)
         }
         return progress
@@ -299,8 +305,12 @@ import OSLog
 
         let progress = Progress(totalUnitCount: 1)
         Task {
-            completionHandler(await item.delete())
+            let error = await item.delete()
+            if error != nil {
+                signalEnumerator(completionHandler: { _ in })
+            }
             progress.completedUnitCount = 1
+            completionHandler(await item.delete())
         }
         return progress
     }