From 3740e9e29dda02692a773859fcbc77b5e49dee47 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Mon, 28 Jul 2025 14:33:34 +0530 Subject: [PATCH] Gracefully handle partial cleanup --- .../apps/photos/lib/services/collections_service.dart | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mobile/apps/photos/lib/services/collections_service.dart b/mobile/apps/photos/lib/services/collections_service.dart index af8c8500b1..aa6a9d5a29 100644 --- a/mobile/apps/photos/lib/services/collections_service.dart +++ b/mobile/apps/photos/lib/services/collections_service.dart @@ -91,10 +91,13 @@ class CollectionsService { await remoteDB.init(); // todo: neeraj move it to local sync service await localDB.init(); - - final newColections = await remoteDB.getAllCollections(); - for (final collection in newColections) { - _cacheLocalPathAndCollection(collection); + if (_config.isLoggedIn()) { + final newColections = await remoteDB.getAllCollections(); + for (final collection in newColections) { + _cacheLocalPathAndCollection(collection); + } + } else { + remoteDB.clearAllTables().ignore(); } Bus.instance.on().listen((event) { _collectionIDToNewestFileTime = null;