π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob] Clean up multipart upload on put or update error
Neeraj Guptaff218c3e4d96
diff --git a/mobile/lib/utils/file_uploader.dart b/mobile/lib/utils/file_uploader.dartindex e55fe7d801..84c33446d1 100644--- a/mobile/lib/utils/file_uploader.dart+++ b/mobile/lib/utils/file_uploader.dart@@ -820,6 +820,9 @@ class FileUploader {// file upload can be be retried in such cases without user interventionuploadHardFailure = false;}+ if (isMultipartUpload && isPutOrUpdateFileError(e)) {+ await UploadLocksDB.instance.deleteMultipartTrack(lockKey);+ }rethrow;} finally {await _onUploadDone(@@ -835,6 +838,14 @@ class FileUploader {}}+ bool isPutOrUpdateFileError(Object e) {+ if (e is DioError) {+ return e.requestOptions.path.contains("/files") ||+ e.requestOptions.path.contains("/files/update");+ }+ return false;+ }+/*_mapToExistingUpload links the fileToUpload with the existing uploadedfiles. if the link is successful, it returns true otherwise false.