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
{{ message }}
Repository navigation
Push: opt-out during an in-flight unregister can strand the DELETE, and opting back in never re-registers the token #746
unregister persists its PendingUnregister and then defers on guard isAllowedProvider() when the SDK is disabled or opted out, and it re-checks consent again after the asynchronous identity-token mint. So unregisterPushNotificationToken() followed closely by opt-out, the standard shape of a host app's opt-out flow, can park the DELETE: the pending record survives, but the same consent gates keep deferring it on every retry while opted out. The server-side subscription stays active for the whole opted-out period and Workflows keep delivering to a device that opted out.
On the way back: a successful DELETE clears the stored token, and opting back in only restores consent and the observer, it doesn't refetch the APNs token or re-register. Push stays dead until the next app restart re-runs registration.
Found while reviewing the React Native push integration (PostHog/posthog-js#4415, thread): the wrapper orders its bridge calls (unregister before opt-out) but that can't order the handler's internal async work, so the fix has to live here.
Proposal
Allow a pending unregister to execute while opted out: a DELETE is data removal, not collection, so the opt-out gate should block registration and sends but not cleanup.
On opt-in with capturePushNotificationSubscriptions enabled, refetch the token and re-register, so opting back in re-arms push without an app restart.
Activity
test(push): move the opt-out repro into the Xcode test target so CI r…
fix(push): only refetch on opt-in when swizzling is enabled (#746)
test(push): fold the opt-out repro into the shared suite fixture (#746)
fix: send the push unregister DELETE even after opt-out (#746) (#759)
fix(push): re-register the device token on opt-in (#746) (#760)