You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tech Debt has been increasing, and we've reached a point in which both PushNotificationsManager and InteractiveNotificationsManager call each other.
We must:
Review all the things
Drop applicationState usage
Definitely drop @objc
Ideally speaking, have 3 classes to deal with the use cases we've got:
Push Notification Received: The document arrived. Used by the AppDelegate
Push Notification Pressed: User interaction was detected. Used by UNUserNotificationCenter
(2) and (3) may need to run the same code in few specific scenarios such as "Push Auth Received" while the app was in foreground, or "Push Auth was pressed".
Reopening. This was closed not_planned in March 2023 by its author with no comment, after sitting untouched since 2020 — which reads as a backlog sweep, not a decision that the refactor shouldn't happen. The debt described above is still here, and it's now compounding rather than static, so it's worth keeping visible.
What's changed since this was filed
Adopting the UIScene life cycle (Adopt the UIScene life cycle #25643) added a third site that sniffs applicationState to infer user intent. Under scenes, a notification-tap cold launch arrives while applicationState == .background (the scene has connected but the foreground transition hasn't completed), so handleInactiveNotification had to widen its guard to applicationState == .inactive || (applicationState == .background && userInteraction). That's the same applicationState/userInteraction workaround handleAuthenticationNotification has carried since 2020 (Fixing Push Authentication #14349) — three copies now.
The original rationale here was that iOS 13 made applicationState != .background unreliable. The scene life cycle makes it less reliable, not more: every lifecycle change Apple ships adds pressure to exactly the signal this issue wants to drop.
The correct signal is already available and ignored — a tap is a UNUserNotificationCenterdidReceive response. Driving "pressed" off that (the split this issue's description already proposes: Received vs Pressed) removes the applicationState guessing entirely.
Unchanged — the plan in the description above still holds. The honest blocker is capacity + regression risk: push is sensitive, OCMock-tested, and multi-state, so a refactor could regress delivery. That makes this a prioritization call — but it's one we should make deliberately, not inherit from a silent close.
@jkmassel I'm afraid really don't remember the state of the WPiOS Notification Stack., TBH.
I do remember there was a big refactor after this ticket was logged, from which I wasn't part of, and perhaps it was no longer relevant (OR we didn't have the bandwidth).
Activity
jkmassel commentedon Jun 17, 2026
Reopening. This was closed
not_plannedin March 2023 by its author with no comment, after sitting untouched since 2020 — which reads as a backlog sweep, not a decision that the refactor shouldn't happen. The debt described above is still here, and it's now compounding rather than static, so it's worth keeping visible.What's changed since this was filed
applicationStateto infer user intent. Under scenes, a notification-tap cold launch arrives whileapplicationState == .background(the scene has connected but the foreground transition hasn't completed), sohandleInactiveNotificationhad to widen its guard toapplicationState == .inactive || (applicationState == .background && userInteraction). That's the sameapplicationState/userInteractionworkaroundhandleAuthenticationNotificationhas carried since 2020 (Fixing Push Authentication #14349) — three copies now.applicationState != .backgroundunreliable. The scene life cycle makes it less reliable, not more: every lifecycle change Apple ships adds pressure to exactly the signal this issue wants to drop.UNUserNotificationCenterdidReceiveresponse. Driving "pressed" off that (the split this issue's description already proposes: Received vs Pressed) removes theapplicationStateguessing entirely.handleNotificationcan drop the remote-notification completion handler, throttling background push delivery #25657 (thehandleNotificationdispatch loop can drop the remote-notification completion handler) — same stack, more evidence it's fragile rather than settled.Scope
Unchanged — the plan in the description above still holds. The honest blocker is capacity + regression risk: push is sensitive, OCMock-tested, and multi-state, so a refactor could regress delivery. That makes this a prioritization call — but it's one we should make deliberately, not inherit from a silent close.
Surfaced while reviewing #25643.
jleandroperez commentedon Jun 17, 2026
@jkmassel I'm afraid really don't remember the state of the WPiOS Notification Stack., TBH.
I do remember there was a big refactor after this ticket was logged, from which I wasn't part of, and perhaps it was no longer relevant (OR we didn't have the bandwidth).
In any case, great excuse to say HEY Jeremy!!
jkmassel commentedon Oct 29, 2026
Status update, rechecked on trunk (
6e19750089).handleNotificationcan drop the remote-notification completion handler, throttling background push delivery #25657 is fixed: Complete unhandled remote notifications #26166 makes sure ignored and unmatched notifications always call the completion handler. It's a narrow fix with no restructuring.PushNotificationsManager.swiftstill has three places that guess intent fromapplicationState(support, auth, and the inactive-notification handler).PushNotificationsManagerandInteractiveNotificationsManagerstill call each other, and the "NukePushNotificationsManager" TODO is unchanged.PushNotificationsManageris still@objc.Keeping this open as tech debt.