marinofaggiana 4 years ago
parent
commit
8bb6e50803

+ 2 - 2
File Provider Extension/FileProviderExtension.swift

@@ -239,7 +239,7 @@ class FileProviderExtension: NSFileProviderExtension {
                 NSFileProviderManager.default.register(task!, forItemWithIdentifier: NSFileProviderItemIdentifier(identifier.rawValue)) { (error) in }
             }
             
-        }) { (account, etag, date, length, errorCode, errorDescription) in
+        }) { (account, etag, date, length, error, errorCode, errorDescription) in
             
             self.outstandingSessionTasks.removeValue(forKey: url)
             
@@ -257,7 +257,7 @@ class FileProviderExtension: NSFileProviderExtension {
             } else {
                 
                 metadata.status = Int(k_metadataStatusDownloadError)
-                metadata.sessionError = errorDescription ?? ""
+                metadata.sessionError = errorDescription
                 NCManageDatabase.sharedInstance.addMetadata(metadata)
 
                 completionHandler(NSFileProviderError(.noSuchItem))

+ 1 - 1
iOSClient/Activity/NCActivity.swift

@@ -398,7 +398,7 @@ extension activityTableViewCell: UICollectionViewDelegate {
                 
             }, progressHandler: { (_) in
                 
-            }) { (account, etag, date, lenght, errorCode, errorDescription) in
+            }) { (account, etag, date, lenght, error, errorCode, errorDescription) in
                 
                 if account == self.appDelegate.activeAccount && errorCode == 0 {
                     

+ 1 - 1
iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift

@@ -499,7 +499,7 @@ import NCCommunication
             
         }, progressHandler: { (_) in
             
-        }) { (account, etag, date, lenght, errorCode, errorDescription) in
+        }) { (account, etag, date, lenght, error, errorCode, errorDescription) in
             
             if errorCode == 0 && account == self.appDelegate.activeAccount {
                 self.collectionView.reloadItems(at: [indexPath])

+ 2 - 2
iOSClient/Main/NCDetailViewController.swift

@@ -700,7 +700,7 @@ extension NCDetailViewController: NCViewerImageViewControllerDelegate, NCViewerI
                                 
                 self.progress(Float(progress.fractionCompleted))
                 
-            }) { (account, etag, date, length, errorCode, errorDescription) in
+            }) { (account, etag, date, length, error, errorCode, errorDescription) in
                 
                 if errorCode == 0 && account == metadata.account {
                     
@@ -813,7 +813,7 @@ extension NCDetailViewController: NCViewerImageViewControllerDelegate, NCViewerI
                                     
                     self.progress(Float(progress.fractionCompleted))
                     
-                }) { (account, etag, date, length, errorCode, errorDescription) in
+                }) { (account, etag, date, length, error, errorCode, errorDescription) in
                     
                     self.progress(0)
                     

+ 3 - 3
iOSClient/Networking/NCNetworking.swift

@@ -235,8 +235,8 @@ import Alamofire
             
             NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_progressTask), object: nil, userInfo: ["account":metadata.account, "ocId":metadata.ocId, "serverUrl":serverUrl, "status":NSNumber(value: k_metadataStatusInDownload), "progress":NSNumber(value: progress.fractionCompleted), "totalBytes":NSNumber(value: progress.totalUnitCount), "totalBytesExpected":NSNumber(value: progress.completedUnitCount)])
             
-        }) { (account, etag, date, length, errorCode, errorDescription) in
-            
+        }) { (account, etag, date, length, error, errorCode, errorDescription) in
+                        
             self.downloadRequest[fileNameLocalPath] = nil
             
             if errorCode == 0 {
@@ -261,7 +261,7 @@ import Alamofire
                                 
                 NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_downloadedFile), object: nil, userInfo: ["metadata":metadata, "selector":selector, "errorCode":errorCode, "errorDescription":errorDescription])
                 
-            } else if errorCode == Int(CFNetworkErrors.cfurlErrorCancelled.rawValue) || errorCode == 200 {
+            } else if error?.isExplicitlyCancelledError ?? false {
                 
                 metadata.session = ""
                 metadata.sessionError = ""

+ 1 - 1
iOSClient/Networking/NCNetworkingE2EE.swift

@@ -272,7 +272,7 @@ import Alamofire
                         
                         NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_uploadedFile), object: nil, userInfo: ["metadata":metadata, "errorCode":errorCode, "errorDescription":""])
                                                         
-                    } else if errorCode == Int(CFNetworkErrors.cfurlErrorCancelled.rawValue) || errorCode == 200 || error?.isExplicitlyCancelledError ?? false { 
+                    } else if error?.isExplicitlyCancelledError ?? false { 
                         
                         CCUtility.removeFile(atPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId))
                         NCManageDatabase.sharedInstance.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))

+ 1 - 1
iOSClient/Viewer/NCViewerRichdocument.swift

@@ -149,7 +149,7 @@ class NCViewerRichdocument: WKWebView, WKNavigationDelegate, WKScriptMessageHand
                             
                         }, progressHandler: { (_) in
                             
-                        }, completionHandler: { (account, etag, date, lenght, errorCode, errorDescription) in
+                        }, completionHandler: { (account, etag, date, lenght, error, errorCode, errorDescription) in
                             
                             if errorCode == 0 && account == self.metadata.account {
                                 if type == "print" {