From 07644201f32cca68a456dc470a5611e578ee6529 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Tue, 18 Jun 2024 16:03:30 -0700 Subject: [PATCH] Make Feedbin syncing fetch articles. --- .../FeedbinAccountDelegate.swift | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Account/Sources/Account/AccountDelegates/FeedbinAccountDelegate.swift b/Account/Sources/Account/AccountDelegates/FeedbinAccountDelegate.swift index 72251437b..31f9158da 100644 --- a/Account/Sources/Account/AccountDelegates/FeedbinAccountDelegate.swift +++ b/Account/Sources/Account/AccountDelegates/FeedbinAccountDelegate.swift @@ -77,14 +77,16 @@ public enum FeedbinAccountDelegateError: String, Error { func refreshAll(for account: Account) async throws { - refreshProgress.addToNumberOfTasksAndRemaining(5) + refreshProgress.addToNumberOfTasks(7) + defer { + refreshProgress.clear() + } do { - try await refreshAccount(account) + try await refreshAccount(account) // 3 tasks + try await refreshArticlesAndStatuses(account) // 4 tasks } catch { - refreshProgress.clear() - let wrappedError = AccountError.wrappedError(error: error, account: account) - throw wrappedError + throw AccountError.wrappedError(error: error, account: account) } } @@ -509,22 +511,27 @@ private extension FeedbinAccountDelegate { forceExpireFolderFeedRelationship(account, tags) let taggings = try await caller.retrieveTaggings() - BatchUpdate.shared.perform { self.syncFolders(account, tags) self.syncFeeds(account, subscriptions) self.syncFeedFolderRelationship(account, taggings) } - refreshProgress.completeTask() } func refreshArticlesAndStatuses(_ account: Account) async throws { try await sendArticleStatus(for: account) + refreshProgress.completeTask() + try await refreshArticleStatus(for: account) + refreshProgress.completeTask() + try await refreshArticles(account) + refreshProgress.completeTask() + try await refreshMissingArticles(account) + refreshProgress.completeTask() } // This function can be deleted if Feedbin updates their taggings.json service to