From c7df800d27c06840ed2e66499f4b731e6d72aae0 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 12 Dec 2023 11:36:37 -0600 Subject: [PATCH] fix(mobile): Fix upload hang on iOS when deleting stale files (#5658) * fix(mobile): Fix upload hang on iOS when deleting stale files * Cleaner fix --- mobile/lib/modules/backup/services/backup.service.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mobile/lib/modules/backup/services/backup.service.dart b/mobile/lib/modules/backup/services/backup.service.dart index 619dfc23b9..4bc6e19867 100644 --- a/mobile/lib/modules/backup/services/backup.service.dart +++ b/mobile/lib/modules/backup/services/backup.service.dart @@ -225,8 +225,6 @@ class BackupService { } final String deviceId = Store.get(StoreKey.deviceId); final String savedEndpoint = Store.get(StoreKey.serverEndpoint); - File? file; - File? livePhotoFile; bool anyErrors = false; final List duplicatedAssetIds = []; @@ -248,6 +246,9 @@ class BackupService { : assetList.toList(); for (var entity in assetsToUpload) { + File? file; + File? livePhotoFile; + try { final isAvailableLocally = await entity.isLocallyAvailable(isOrigin: true);