From 31621f9bd3ad6f2d859813c01b50a1f2c0ed57e6 Mon Sep 17 00:00:00 2001 From: Iva Horn Date: Thu, 4 Jun 2026 10:25:40 +0200 Subject: [PATCH 1/2] fix(file-provider): Updated API calls NextcloudKit dependency to breaking changes in 7.3.3 fix(file-provider): Updated API calls NextcloudKit dependency to breaking changes in 7.3.3 Signed-off-by: Iva Horn [skip ci] --- .../xcshareddata/swiftpm/Package.resolved | 10 ++++---- .../NextcloudFileProviderKit/Package.swift | 2 +- .../NextcloudKit+RemoteInterface.swift | 12 +++++++++- .../Interface/RemoteInterface.swift | 6 +---- .../Item/Item+Fetch.swift | 4 ++-- .../TestableRemoteInterface.swift | 8 ++----- .../Tests/Interface/MockRemoteInterface.swift | 24 +++++-------------- 7 files changed, 28 insertions(+), 38 deletions(-) diff --git a/Nextcloud Desktop Client.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Nextcloud Desktop Client.xcworkspace/xcshareddata/swiftpm/Package.resolved index 4da9babee84be..56797a9923f12 100644 --- a/Nextcloud Desktop Client.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Nextcloud Desktop Client.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -58,10 +58,10 @@ { "identity" : "swift-argument-parser", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-argument-parser", + "location" : "https://github.com/apple/swift-argument-parser.git", "state" : { - "revision" : "626b5b7b2f45e1b0b1c6f4a309296d1d21d7311b", - "version" : "1.7.1" + "revision" : "ca37474853a4b5f59a22c74bfdd449b1f6bc4cc2", + "version" : "1.8.1" } }, { @@ -78,8 +78,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-collections.git", "state" : { - "revision" : "6675bc0ff86e61436e615df6fc5174e043e57924", - "version" : "1.4.1" + "revision" : "fea17c02d767f46b23070fdfdacc28a03a39232a", + "version" : "1.5.1" } }, { diff --git a/shell_integration/MacOSX/NextcloudFileProviderKit/Package.swift b/shell_integration/MacOSX/NextcloudFileProviderKit/Package.swift index 76fe868af933f..c134a6b11cc18 100644 --- a/shell_integration/MacOSX/NextcloudFileProviderKit/Package.swift +++ b/shell_integration/MacOSX/NextcloudFileProviderKit/Package.swift @@ -17,7 +17,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/nextcloud/NextcloudCapabilitiesKit.git", from: "2.5.0"), - .package(url: "https://github.com/nextcloud/NextcloudKit", from: "7.2.3"), + .package(url: "https://github.com/nextcloud/NextcloudKit", from: "7.3.3"), .package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.55.0"), .package(url: "https://github.com/realm/realm-swift.git", from: "20.0.4"), .package(url: "https://github.com/apple/swift-nio.git", from: "2.0.0") diff --git a/shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Interface/NextcloudKit+RemoteInterface.swift b/shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Interface/NextcloudKit+RemoteInterface.swift index 4f11b263200b4..64c3b731c2d24 100644 --- a/shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Interface/NextcloudKit+RemoteInterface.swift +++ b/shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Interface/NextcloudKit+RemoteInterface.swift @@ -60,7 +60,17 @@ extension NextcloudKit: RemoteInterface { requestHandler: requestHandler, taskHandler: taskHandler, progressHandler: progressHandler - ) { account, ocId, etag, date, size, response, nkError in + ) { account, response, nkError in + let allHeaderFields = response?.response?.allHeaderFields + let ocId = self.nkCommonInstance.findHeader("oc-fileid", allHeaderFields: allHeaderFields) + let etag = self.nkCommonInstance.normalizedETag(self.nkCommonInstance.findHeader("oc-etag", allHeaderFields: allHeaderFields)) + let date = self.nkCommonInstance.findHeader("date", allHeaderFields: allHeaderFields)?.parsedDate(using: "EEE, dd MMM y HH:mm:ss zzz") + var size: Int64 = 0 + + if let value = allHeaderFields?["Content-Length"] as? String { + size = Int64(value) ?? 0 + } + continuation.resume(returning: ( account, ocId, diff --git a/shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Interface/RemoteInterface.swift b/shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Interface/RemoteInterface.swift index 9657fe5be074b..ac29987f2d141 100644 --- a/shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Interface/RemoteInterface.swift +++ b/shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Interface/RemoteInterface.swift @@ -86,11 +86,7 @@ public protocol RemoteInterface: Sendable { progressHandler: @escaping (_ progress: Progress) -> Void ) async -> ( account: String, - etag: String?, - date: Date?, - length: Int64, - headers: [AnyHashable: any Sendable]?, - afError: AFError?, + response: AFDownloadResponse?, nkError: NKError ) diff --git a/shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Item/Item+Fetch.swift b/shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Item/Item+Fetch.swift index 59dbcedf871b0..db41feac39f45 100644 --- a/shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Item/Item+Fetch.swift +++ b/shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Item/Item+Fetch.swift @@ -66,7 +66,7 @@ public extension Item { } else { let identifier = NSFileProviderItemIdentifier(metadata.ocId) - let (_, _, _, _, _, _, error) = await remoteInterface.downloadAsync( + let (_, _, error) = await remoteInterface.downloadAsync( serverUrlFileName: remotePath, fileNameLocalPath: childLocalPath, account: account.ncKitAccount, @@ -176,7 +176,7 @@ public extension Item { } } else { - let (_, _, _, _, _, _, error) = await remoteInterface.downloadAsync( + let (_, _, error) = await remoteInterface.downloadAsync( serverUrlFileName: serverUrlFileName, fileNameLocalPath: localPath.path, account: account.ncKitAccount, diff --git a/shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKitMocks/TestableRemoteInterface.swift b/shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKitMocks/TestableRemoteInterface.swift index 4d804aad3bb7a..5c60a0df4b499 100644 --- a/shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKitMocks/TestableRemoteInterface.swift +++ b/shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKitMocks/TestableRemoteInterface.swift @@ -96,14 +96,10 @@ public struct TestableRemoteInterface: RemoteInterface, @unchecked Sendable { progressHandler _: @escaping (_ progress: Progress) -> Void ) async -> ( account: String, - etag: String?, - date: Date?, - length: Int64, - headers: [AnyHashable: any Sendable]?, - afError: AFError?, + response: AFDownloadResponse?, nkError: NKError ) { - ("", nil, nil, 0, nil, nil, .invalidResponseError) + ("", nil, .invalidResponseError) } public func enumerate( diff --git a/shell_integration/MacOSX/NextcloudFileProviderKit/Tests/Interface/MockRemoteInterface.swift b/shell_integration/MacOSX/NextcloudFileProviderKit/Tests/Interface/MockRemoteInterface.swift index 1c83397b82380..bb67665e944e1 100644 --- a/shell_integration/MacOSX/NextcloudFileProviderKit/Tests/Interface/MockRemoteInterface.swift +++ b/shell_integration/MacOSX/NextcloudFileProviderKit/Tests/Interface/MockRemoteInterface.swift @@ -1034,23 +1034,19 @@ public class MockRemoteInterface: RemoteInterface, @unchecked Sendable { progressHandler _: @escaping (_ progress: Progress) -> Void = { _ in } ) async -> ( account: String, - etag: String?, - date: Date?, - length: Int64, - headers: [AnyHashable: any Sendable]?, - afError: AFError?, + response: AFDownloadResponse?, nkError: NKError ) { guard let serverUrlFileName = serverUrlFileName as? String ?? (serverUrlFileName as? URL)?.absoluteString else { - return (account, nil, nil, 0, nil, nil, .urlError) + return (account, nil, .urlError) } guard let account = mockedAccounts[account] else { - return (account, nil, nil, 0, nil, nil, .urlError) + return (account, nil, .urlError) } guard let item = item(remotePath: serverUrlFileName, account: account.ncKitAccount) else { - return (account.ncKitAccount, nil, nil, 0, nil, nil, .urlError) + return (account.ncKitAccount, nil, .urlError) } let localUrl = URL(fileURLWithPath: fileNameLocalPath) @@ -1066,18 +1062,10 @@ public class MockRemoteInterface: RemoteInterface, @unchecked Sendable { } } catch { print("Could not write item data: \(error)") - return (account.ncKitAccount, nil, nil, 0, nil, nil, .urlError) + return (account.ncKitAccount, nil, .urlError) } - return ( - account.ncKitAccount, - item.versionIdentifier, - item.creationDate as Date, - item.size, - nil, - nil, - .success - ) + return (account.ncKitAccount, nil, .success) } public func enumerate( From b809ef706d213630b0da156988ed7aeb8440a7b8 Mon Sep 17 00:00:00 2001 From: Iva Horn Date: Thu, 4 Jun 2026 12:34:50 +0200 Subject: [PATCH 2/2] fix(file-provider): Pin NextcloudKit 7.3.3 in workspace Package.resolved The Package.swift update to NextcloudKit 7.3.3 was applied, but the workspace's Package.resolved was left pinning 7.2.6 due to a merge conflict during the auto-backport. Without this pin update, Xcode resolves the old revision and breaks the 7.3.3-API call sites this backport adds. Signed-off-by: Iva Horn Co-Authored-By: Claude Opus 4.7 (1M context) --- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nextcloud Desktop Client.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Nextcloud Desktop Client.xcworkspace/xcshareddata/swiftpm/Package.resolved index 56797a9923f12..7968c81f74a66 100644 --- a/Nextcloud Desktop Client.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Nextcloud Desktop Client.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -24,8 +24,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/nextcloud/NextcloudKit", "state" : { - "revision" : "ffae68384f77c260168698a02a69d622cc2e0f0f", - "version" : "7.2.6" + "revision" : "ef7b20a5dab6061d4139f943e824981369ef949e", + "version" : "7.3.3" } }, {