Undo the destination add when a Feedly feed move fails halfway, instead of leaving the feed in both folders.

This commit is contained in:
Brent Simmons committed 2026-08-03 15:06:30 -07:00
1 parent 92f36349b9
commit 2ff432cfa6
1 file changed
+4
@@ -740,6 +740,10 @@ import Secrets
do {
try await caller.removeFeed(feed.feedID, fromCollectionWith: fromCollectionID)
} catch {
// Undo the whole move — without removing the remote add and the local
// destination copy, the feed ends up in both folders permanently.
try? await caller.removeFeed(feed.feedID, fromCollectionWith: toCollectionID)
to.removeFeedFromTreeAtTopLevel(feed)
from.addFeedToTreeAtTopLevel(feed)
throw FeedlyAccountDelegateError.unableToMoveFeedBetweenFolders(feed.nameForDisplay, from.nameForDisplay, to.nameForDisplay)
}