Skip to content

Commit ee1641d

Browse files
committed
Properly account for (non-error) collision errors during bundle create/modify
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
1 parent edfe1bf commit ee1641d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

Sources/NextcloudFileProviderKit/Item/Item+Create.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ public extension Item {
348348
progressHandler: { _ in }
349349
)
350350

351-
guard error == .success else {
351+
// Do not fail on existing item, just keep going
352+
guard error == .success || error.matchesCollisionError else {
352353
Self.logger.error(
353354
"""
354355
Could not upload bpi file at: \(childUrlPath, privacy: .public),

Sources/NextcloudFileProviderKit/Item/Item+Modify.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,8 @@ public extension Item {
385385
}
386386
}
387387
)
388-
guard createError == .success else {
388+
// Don't error if there is a collision
389+
guard createError == .success || createError.matchesCollisionError else {
389390
Self.logger.error(
390391
"""
391392
Could not create new bpi folder at: \(remotePath, privacy: .public),

0 commit comments

Comments
 (0)