Skip to content

Commit

Permalink
webdav: block download changes when download collectibles failed
Browse files Browse the repository at this point in the history
  • Loading branch information
Predidit committed Feb 4, 2025
1 parent 5218302 commit 7507f69
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/utils/webdav.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7507f69

Please sign in to comment.