From ea4b1759bf3c67852fba897a7f309917558f43a4 Mon Sep 17 00:00:00 2001 From: polo2187 <310494972+polo2187@users.noreply.github.com> Date: Wed, 29 Jul 2026 09:57:46 +0200 Subject: [PATCH] Do not clear delivered notifications on app activate --- .../Notifications/UserNotificationsPresenter.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SignalServiceKit/Notifications/UserNotificationsPresenter.swift b/SignalServiceKit/Notifications/UserNotificationsPresenter.swift index 623eb8f8953..dd30e897f74 100644 --- a/SignalServiceKit/Notifications/UserNotificationsPresenter.swift +++ b/SignalServiceKit/Notifications/UserNotificationsPresenter.swift @@ -327,7 +327,7 @@ public class UserNotificationPresenter { } public func clearNotificationsForAppActivate() { - Logger.info("Clearing notifications for app activate.") + Logger.info("Clearing pending notifications for app activate.") Task { let shouldRemoveNotificationRequestPredicate: (UNNotificationRequest) -> Bool = { request in @@ -346,12 +346,12 @@ public class UserNotificationPresenter { .filter { shouldRemoveNotificationRequestPredicate($0) } .map(\.identifier) - let deliveredNotificationIDsToRemove = await Self.notificationCenter.deliveredNotifications() - .filter { shouldRemoveNotificationRequestPredicate($0.request) } - .map(\.request.identifier) + // Do not remove delivered notifications on app activate. + // Delivered notifications should remain visible in Notification Center + // until the related conversation is actually opened/read and canceled + // through the normal thread/message-specific cancellation paths. Self.notificationCenter.removePendingNotificationRequests(withIdentifiers: pendingNotificationIDsToRemove) - Self.notificationCenter.removeDeliveredNotifications(withIdentifiers: deliveredNotificationIDsToRemove) } }