Fix root cause of threading issues with metadata updates

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-03-10 22:09:19 +01:00
parent 7c8aab38d2
commit 1a48e4e06e
No known key found for this signature in database
GPG key ID: C839200C384636B0

View file

@ -157,7 +157,7 @@ class NextcloudFilesDatabaseManager : NSObject {
if existingMetadata.status == NextcloudItemMetadataTable.Status.normal.rawValue &&
!existingMetadata.isInSameRemoteState(updatedMetadata) {
returningUpdatedMetadatas.append(updatedMetadata)
returningUpdatedMetadatas.append(NextcloudItemMetadataTable(value: updatedMetadata))
databaseToWriteTo.add(updatedMetadata, update: .all)
NSLog("""
@ -178,7 +178,7 @@ class NextcloudFilesDatabaseManager : NSObject {
}
} else { // This is a new metadata
returningNewMetadatas.append(updatedMetadata)
returningNewMetadatas.append(NextcloudItemMetadataTable(value: updatedMetadata))
databaseToWriteTo.add(updatedMetadata, update: .all)
NSLog("""