From 345840d9ccc66f2031206be37835b4f32ba0087e Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Mon, 6 Jul 2026 12:56:34 -0700 Subject: [PATCH] Adjust Push Notification Logic Nucleic-Session: 0F065CD6-20FE-4941-ACF5-C57A4572A5A3 Co-authored-by: Nucleic --- NucleicRemote/NucleicRemote/PushRegistrar.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/NucleicRemote/NucleicRemote/PushRegistrar.swift b/NucleicRemote/NucleicRemote/PushRegistrar.swift index ceb5a73..0f0b7b5 100644 --- a/NucleicRemote/NucleicRemote/PushRegistrar.swift +++ b/NucleicRemote/NucleicRemote/PushRegistrar.swift @@ -55,10 +55,11 @@ final class PushAppDelegate: NSObject, UIApplicationDelegate { didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void ) { - guard userInfo["clear"] != nil else { completionHandler(.noData); return } - Task { @MainActor in - NotificationRouter.shared.withdrawApprovalAttention() - completionHandler(.noData) + if userInfo["clear"] != nil { + // Fire-and-forget on the main actor (NotificationRouter is @MainActor); the removal is a + // quick UNUserNotificationCenter call, so we can report .noData right away. + Task { @MainActor in NotificationRouter.shared.withdrawApprovalAttention() } } + completionHandler(.noData) } }