From 7da003a01d82066d2ec5a8f6f8e4b827743aa400 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 11 Nov 2022 19:42:10 -0600 Subject: [PATCH] Continue processing if there is a Feedbin delete error. Fixes #3611 --- .../Feedbin/FeedbinAccountDelegate.swift | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift b/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift index 7b364e237..c73b5ef05 100644 --- a/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift +++ b/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift @@ -1407,27 +1407,29 @@ private extension FeedbinAccountDelegate { completion(.failure(FeedbinAccountDelegateError.invalidParameter)) return } + + func complete() { + DispatchQueue.main.async { + account.clearWebFeedMetadata(feed) + account.removeWebFeed(feed) + if let folders = account.folders { + for folder in folders { + folder.removeWebFeed(feed) + } + } + completion(.success(())) + } + } refreshProgress.addToNumberOfTasksAndRemaining(1) caller.deleteSubscription(subscriptionID: subscriptionID) { result in self.refreshProgress.completeTask() switch result { case .success: - DispatchQueue.main.async { - account.clearWebFeedMetadata(feed) - account.removeWebFeed(feed) - if let folders = account.folders { - for folder in folders { - folder.removeWebFeed(feed) - } - } - completion(.success(())) - } + complete() case .failure(let error): - DispatchQueue.main.async { - let wrappedError = AccountError.wrappedError(error: error, account: account) - completion(.failure(wrappedError)) - } + self.logger.error("Unable to remove feed from Feedbin. Removing locally and continue processing: \(error.localizedDescription, privacy: .public)") + complete() } }