Fix requiring privacy consent blocks confirmed deliveries indefinitely#1541
Merged
Fix requiring privacy consent blocks confirmed deliveries indefinitely#1541
Conversation
* Keeping this method is misleading, it is no longer used by anything * Instead, logic is using the `requiresUserPrivacyConsent` method instead that considers the plist value.
The migration controller's `migrateToVersion_02_14_00_AndGreater` method is the exact method as `[OSOutcomes migrate]`. This was duplicated unnecessarily during modularization of the SDK.
* Each module will own its migration and a separate cached SDK version to determine if it should do a migration. * This change is made because it is possible for one module to migrate while another has not yet, and caching the same SDK version will affect the second module's future migration when it reads the version from cache. * For example, this is currently a bug as of 5.2.9: - The extension can receive a notification during the time an app is updated without the app being initialized/launched before. This path calls a migration in the outcomes module. When the outcomes module is done migrating, it caches the new SDK version, overriding the previous cached version. - The next time the app starts up, in app messages may need to migrate but it is using the new SDK version that is cached by outcomes above, and skip a necessary migration.
d045e22 to
959cf10
Compare
* Previously this was saved only to the standard user defaults so it could not be read by the NSE, which blocked confirmed deliveries from being sent, even after consent has been granted. * Additionally, migrate this from the standard user defaults to the shared user defaults.
959cf10 to
6054ff7
Compare
jkasten2
requested changes
Feb 13, 2025
jkasten2
approved these changes
Feb 13, 2025
This was referenced Feb 14, 2025
Merged
This was referenced Feb 25, 2025
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
Setting consent required and then providing consent still blocked confirmed deliveries from being sent - this PR fixes that.
Details
The consent required value was being written to / read from the shared user defaults but the consent granted value was written to / read from standard user defaults (which is not accessible to the NSE).
This PR also fixes a migration bug (and creates more migrations to fix that and fix the bug in this PR) that arose after modularizing the SDK.
Motivation
Reported by customers, and we should send confirmed deliveries once consent is granted.
Scope
Testing
Unit testing
None added, little infrastructure
Manual testing
iPhone 13 with iOS 18.1
Fix the bug in this PR
main, set consent required, and then provide consentFix the existing migration bug
2.0.0and the new version is5.2.10.OSOutcomes2.0.0is read from cache to determine if migration is needed, and the new SDK version is cached. Outcomes is migrated now.5.2.10and does not do a migration, even if it is necessary. The migration controller invokes in app messages to migrate.Affected code checklist
Checklist
Overview
Testing
Final pass
This change is