Repository navigation
Conversation
Activities with the same OneSignal activityId share one update token registration, so dismissing a duplicate froze the survivor and only the last registered widget updated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
One Line Summary
End duplicate Live Activities at startup and keep their shared update token when one is dismissed. SDK-5580.
Details
Motivation
When two subscriptions on one device hold the same push-to-start token, one push starts two Live Activities with the same OneSignal activityId. They share one update token registration, so only the activity registered last receives updates, and dismissing either one removed the registration and froze the other.
Scope
setup(), live activities that share an activityId are reduced to one. The SDK keeps the activity whose push token matches the cached update token, otherwise the first one with a token, ends the rest immediately, and attaches listeners only to the kept one. Needs iOS 16.2, like the existing dedupe of newly started activities.enterandexitthemselves.Testing
Unit testing
Tests with fake activities cover grouping by activityId (ended and dismissed activities excluded), choosing the activity to keep, ending all but one per group, and the dismissal check. Two executor tests cover reading the cached update token, including when a removal is pending. ActivityKit activities cannot be created in unit tests, so the wiring in
listenForActivityis not covered.Manual testing
The full Reduced unit test plan passes locally on an iPhone 17 Pro simulator (iOS 26.5), 647 tests with 0 failures. Not run on a device with duplicate Live Activities.
Affected code checklist
Checklist
Overview
Testing
Final pass
🤖 Generated with Claude Code