Always signal enumerator after errors to try and recover from what the error might have been

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-04-16 21:27:47 +08:00
parent 33e2c084a5
commit 6a64248ff6
No known key found for this signature in database
GPG Key ID: C839200C384636B0
1 changed files with 11 additions and 1 deletions

View 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
}