diff --git a/lib/services/collections_service.dart b/lib/services/collections_service.dart index 8d1942092..5be3ef487 100644 --- a/lib/services/collections_service.dart +++ b/lib/services/collections_service.dart @@ -92,7 +92,7 @@ class CollectionsService { // sync method fetches just sync the collections, not the individual files // within the collection. - Future> sync() async { + Future sync() async { _logger.info("Syncing collections"); final EnteWatch watch = EnteWatch("syncCollection")..start(); final lastCollectionUpdationTime = @@ -101,7 +101,10 @@ class CollectionsService { // Might not have synced the collection fully final fetchedCollections = await _fetchCollections(lastCollectionUpdationTime); - watch.log("remote fetch"); + watch.log("remote fetch collections ${fetchedCollections.length}"); + if (fetchedCollections.isEmpty) { + return; + } final updatedCollections = []; int maxUpdationTime = lastCollectionUpdationTime; final ownerID = _config.getUserID(); @@ -152,7 +155,6 @@ class CollectionsService { ), ); } - return collections; } void clearCache() {