From 45443280420c8edbf3b03b0b4b758ebfb2c02fec Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 31 Aug 2026 07:17:27 -0700 Subject: [PATCH] Avoid a potential hang by calling the previous completion before setting a new one. --- .../Sources/Account/LocalAccount/LocalAccountRefresher.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Modules/Account/Sources/Account/LocalAccount/LocalAccountRefresher.swift b/Modules/Account/Sources/Account/LocalAccount/LocalAccountRefresher.swift index 6a4c6ef86..f5268a093 100644 --- a/Modules/Account/Sources/Account/LocalAccount/LocalAccountRefresher.swift +++ b/Modules/Account/Sources/Account/LocalAccount/LocalAccountRefresher.swift @@ -143,6 +143,11 @@ import os let urls = filteredFeeds.compactMap { Self.url(for: $0) } + // This refresh replaces any in-flight one, so resume its caller rather than stranding it. + if let previousCompletion = self.completion { + previousCompletion() + } + self.completion = completion downloadSession.download(Set(urls)) }