From 7507f69c765a20b92b07e27a542535fe92f72474 Mon Sep 17 00:00:00 2001 From: Predidit <34627277+Predidit@users.noreply.github.com> Date: Tue, 4 Feb 2025 10:11:10 +0800 Subject: [PATCH] webdav: block download changes when download collectibles failed --- lib/utils/webdav.dart | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/utils/webdav.dart b/lib/utils/webdav.dart index 7fa8a4eb..18c23685 100644 --- a/lib/utils/webdav.dart +++ b/lib/utils/webdav.dart @@ -160,19 +160,18 @@ class WebDav { }); await Future.wait([collectiblesFuture, changesFuture]); + + // we should block download changes when download collectibles failed + // download changes failed but collectibles success means remote files broken or newwork error + // we should force push local collectibles to remote to fix it try { remoteCollectibles = await GStorage.getCollectiblesFromFile( '${webDavLocalTempDirectory.path}/collectibles.tmp'); - } catch (e) { - KazumiLogger() - .log(Level.error, 'webDav get collectibles from file failed $e'); - } - try { remoteChanges = await GStorage.getCollectChangesFromFile( '${webDavLocalTempDirectory.path}/collectChanges.tmp'); } catch (e) { KazumiLogger() - .log(Level.error, 'webDav get collect changes from file failed $e'); + .log(Level.error, 'webDav get collectibles from file failed $e'); } if (remoteChanges.isNotEmpty || remoteCollectibles.isNotEmpty) { await GStorage.patchCollectibles(remoteCollectibles, remoteChanges);