Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/NextcloudKit/NKCommon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}

public protocol NextcloudKitDelegate: AnyObject, Sendable {
func authenticationChallenge(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void)
func authenticationChallenge(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @Sendable @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void)
func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession)

func networkReachabilityObserver(_ typeReachability: NKTypeReachability)
Expand Down Expand Up @@ -129,7 +129,7 @@
do {
try fileManager.createDirectory(atPath: outputDirectory, withIntermediateDirectories: true, attributes: nil)
} catch {
return completion([], NSError(domain: "chunkedFile", code: -2,userInfo: [NSLocalizedDescriptionKey: "Failed to create the output directory for file chunks."]))

Check warning on line 132 in Sources/NextcloudKit/NKCommon.swift

View workflow job for this annotation

GitHub Actions / Lint

Comma Spacing Violation: There should be no space before and one after any comma (comma)
}
}

Expand Down Expand Up @@ -176,7 +176,7 @@

let safeBuffer = Data(rawBuffer)


Check warning on line 179 in Sources/NextcloudKit/NKCommon.swift

View workflow job for this annotation

GitHub Actions / Lint

Vertical Whitespace Violation: Limit vertical whitespace to a single empty line; currently 2 (vertical_whitespace)
if writer == nil {
let fileNameChunk = String(counter)
let outputFileName = outputDirectory + "/" + fileNameChunk
Expand Down
2 changes: 1 addition & 1 deletion Sources/NextcloudKit/NKError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extension OCSPath {
static var ocsXMLMsg: Self { ["d:error", "s:message"] }
}

public struct NKError: Error, Equatable {
public struct NKError: Error, Equatable, Sendable {
static let internalError = -9999
public let errorCode: Int
public let errorDescription: String
Expand Down
2 changes: 1 addition & 1 deletion Sources/NextcloudKit/NKRequestOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import Foundation

public class NKRequestOptions: NSObject {
final public class NKRequestOptions: NSObject, Sendable {
public let endpoint: String?
public let version: String?
internal(set) public var customHeader: [String: String]?
Expand Down
4 changes: 2 additions & 2 deletions Sources/NextcloudKit/NextcloudKit+Download.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public extension NextcloudKit {
requestHandler: @escaping (_ request: DownloadRequest) -> Void = { _ in },
taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in },
progressHandler: @escaping (_ progress: Progress) -> Void = { _ in },
completionHandler: @escaping (_ account: String, _ etag: String?, _ date: Date?, _ lenght: Int64, _ headers: [AnyHashable: Any]?, _ afError: AFError?, _ nKError: NKError) -> Void) {
completionHandler: @escaping (_ account: String, _ etag: String?, _ date: Date?, _ lenght: Int64, _ headers: [AnyHashable: any Sendable]?, _ afError: AFError?, _ nKError: NKError) -> Void) {
var convertible: URLConvertible?
if serverUrlFileName is URL {
convertible = serverUrlFileName as? URLConvertible
Expand Down Expand Up @@ -103,7 +103,7 @@ public extension NextcloudKit {
etag: String?,
date: Date?,
length: Int64,
headers: [AnyHashable: Any]?,
headers: [AnyHashable: any Sendable]?,
afError: AFError?,
nkError: NKError
) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/NextcloudKit/NextcloudKit+WebDAV.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ public extension NextcloudKit {
showHiddenFiles: Bool,
account: String,
options: NKRequestOptions = NKRequestOptions(),
taskHandler: @escaping (_ task: URLSessionTask) -> Void = { _ in }
taskHandler: @Sendable @escaping (_ task: URLSessionTask) -> Void = { _ in }
) async -> (
account: String,
items: [NKTrash]?,
Expand Down
2 changes: 1 addition & 1 deletion Sources/NextcloudKit/NextcloudKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
import Alamofire
import SwiftyJSON

open class NextcloudKit {
open class NextcloudKit: @unchecked Sendable {
#if swift(<6.0)
public static let shared: NextcloudKit = {
let instance = NextcloudKit()
Expand Down
Loading