Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added a persistence layer over keys stored in standard defaults by rudderstack #454

Conversation

desusai7
Copy link
Contributor

fix: added a persistence layer over keys stored in standard defaults by rudderstack.

  • Added RSDefaultsPersistence (persistence layer for standard defaults), which stores a copy of the Standard defaults in a .plist file and adds them back to the Standard defaults on the next launch if they were deleted by the app developer but not by the SDK itself.
  • Upon migrating to a version of SDK that contains RSDefaultsPersistence from an SDK version that doesn't contain it, we will do a one-time copy of Rudderstack-related user defaults from standard defaults to the persistence layer.
  • Every time we do a read/write/delete to the standard defaults, we perform the same on the persistence layer to maintain the same state.
  • We cannot eliminate the usage of Standard defaults to maintain backward compatibility.
  • This will fix the issues where clearing of standard defaults by the app developer leads to inconsistencies in the behaviour of the SDK.

@desusai7 desusai7 self-assigned this Jan 30, 2024
@desusai7 desusai7 changed the title fix: added a persistence layer over keys stored in standard defaults by rudderstack. fix: added a persistence layer over keys stored in standard defaults by rudderstack Jan 31, 2024
@desusai7 desusai7 marked this pull request as ready for review January 31, 2024 13:50
pallabmaiti
pallabmaiti previously approved these changes Jan 31, 2024
Copy link

sonarcloud bot commented Feb 20, 2024

@desusai7 desusai7 merged commit 1c52a07 into develop Feb 20, 2024
9 checks passed
@desusai7 desusai7 deleted the feature/sdk-1194-creating-scoped-user-defaults-using-alternatives-for-user branch March 28, 2024 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants