From 13aedbad297dd56338a6ee3a0ed535fed77b6b66 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 3 Aug 2026 11:07:55 -0700 Subject: [PATCH] Clear stale in-flight status selections at launch, so statuses queued when the app was killed get sent. --- .../Sources/Account/Feedbin/FeedbinAccountDelegate.swift | 5 +++++ .../Sources/Account/Feedly/FeedlyAccountDelegate.swift | 5 +++++ .../Sources/Account/NewsBlur/NewsBlurAccountDelegate.swift | 5 +++++ .../Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/Modules/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift b/Modules/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift index f886f615a..19e8f2ec5 100644 --- a/Modules/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift +++ b/Modules/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift @@ -449,6 +449,11 @@ public enum FeedbinAccountDelegateError: String, Error, Sendable { func accountDidInitialize() { credentials = try? account?.retrieveCredentials(type: .basic) + + // A send in progress when the app was killed left its statuses selected. Clear them so + // they get sent, instead of waiting for the next selectForProcessing to pick them up. + // + syncDatabase.resetAllSelectedForProcessing() } func accountWillBeDeleted() { diff --git a/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift b/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift index b6a6aa5e8..d50bc90ff 100644 --- a/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift +++ b/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift @@ -637,6 +637,11 @@ import Secrets } Self.logger.debug("FeedlyAccountDelegate: accountDidInitialize") credentials = try? account.retrieveCredentials(type: .oauthAccessToken) + + // A send in progress when the app was killed left its statuses selected. Clear them so + // they get sent, instead of waiting for the next selectForProcessing to pick them up. + // + syncDatabase.resetAllSelectedForProcessing() } func accountWillBeDeleted() { diff --git a/Modules/Account/Sources/Account/NewsBlur/NewsBlurAccountDelegate.swift b/Modules/Account/Sources/Account/NewsBlur/NewsBlurAccountDelegate.swift index dcd328f07..15a1eccc6 100644 --- a/Modules/Account/Sources/Account/NewsBlur/NewsBlurAccountDelegate.swift +++ b/Modules/Account/Sources/Account/NewsBlur/NewsBlurAccountDelegate.swift @@ -511,6 +511,11 @@ import Secrets func accountDidInitialize() { credentials = try? account?.retrieveCredentials(type: .newsBlurSessionID) + + // A send in progress when the app was killed left its statuses selected. Clear them so + // they get sent, instead of waiting for the next selectForProcessing to pick them up. + // + syncDatabase.resetAllSelectedForProcessing() } func accountWillBeDeleted() { diff --git a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift index 36f97bae1..184072312 100644 --- a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift +++ b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift @@ -677,6 +677,11 @@ final class ReaderAPIAccountDelegate: AccountDelegate { return } retrieveCredentialsIfNeeded(account) + + // A send in progress when the app was killed left its statuses selected. Clear them so + // they get sent, instead of waiting for the next selectForProcessing to pick them up. + // + syncDatabase.resetAllSelectedForProcessing() } func accountWillBeDeleted() {