Ensure upload errors for modified files are recorded in FileProviderExtension

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-03-14 23:27:14 +01:00
parent f4be264eee
commit 4e536dcd65
No known key found for this signature in database
GPG key ID: C839200C384636B0

View file

@ -495,6 +495,12 @@ class FileProviderExtension: NSObject, NSFileProviderReplicatedExtension, NKComm
guard error == .success, let ocId = ocId/*, size == itemTemplate.documentSize as! Int64*/ else {
Logger.fileTransfer.error("Could not upload item \(item.itemIdentifier.rawValue, privacy: .public) with filename: \(item.filename, privacy: OSLogPrivacy.auto(mask: .hash)), received error: \(error, privacy: .public)")
metadata.status = NextcloudItemMetadataTable.Status.uploadError.rawValue
metadata.sessionError = error.errorDescription
dbManager.addItemMetadata(metadata)
completionHandler(modifiedItem, [], false, error.toFileProviderError())
return
}