-
Notifications
You must be signed in to change notification settings - Fork 86
Migrate RC SharedPreferences data to a separate file #2621
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
Conversation
@@ -30,12 +28,6 @@ internal class DiagnosticsSynchronizer( | |||
|
|||
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) | |||
const val MAX_EVENTS_TO_SYNC_PER_REQUEST: Int = 200 | |||
|
|||
fun initializeSharedPreferences(context: Context): SharedPreferences = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was unused, so I took the chance to delete it. I think it might be worth moving all the shared preferences handling to the new SharedPreferencesManager
... but didn't want to overcomplicate this PR.
editor.putFloat(key, value) | ||
true | ||
} | ||
is Set<*> -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the only types of data that we store in the shared preferences files (we actually don't use booleans/ints/floats... but I thought it might be good to add just in case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea agreed!
purchases/src/main/kotlin/com/revenuecat/purchases/common/SharedPreferencesManager.kt
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2621 +/- ##
==========================================
+ Coverage 78.41% 78.47% +0.05%
==========================================
Files 301 302 +1
Lines 11241 11303 +62
Branches 1561 1571 +10
==========================================
+ Hits 8815 8870 +55
- Misses 1740 1745 +5
- Partials 686 688 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice to have this! Just some suggestions.
purchases/src/main/kotlin/com/revenuecat/purchases/PurchasesOrchestrator.kt
Outdated
Show resolved
Hide resolved
purchases/src/main/kotlin/com/revenuecat/purchases/common/SharedPreferencesManager.kt
Outdated
Show resolved
Hide resolved
purchases/src/main/kotlin/com/revenuecat/purchases/common/SharedPreferencesManager.kt
Outdated
Show resolved
Hide resolved
purchases/src/main/kotlin/com/revenuecat/purchases/common/SharedPreferencesManager.kt
Outdated
Show resolved
Hide resolved
editor.putFloat(key, value) | ||
true | ||
} | ||
is Set<*> -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea agreed!
purchases/src/test/java/com/revenuecat/purchases/common/SharedPreferencesManagerTest.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes! Just one more suggestion haha
purchases/src/main/kotlin/com/revenuecat/purchases/common/SharedPreferencesManager.kt
Outdated
Show resolved
Hide resolved
purchases/src/main/kotlin/com/revenuecat/purchases/common/SharedPreferencesManager.kt
Outdated
Show resolved
Hide resolved
### Description We migrated to a new shared preferences file in #2621, but we didn't update the integration tests to use the new file. This fixes those integration tests.
### Description We were storing data in the default shared preferences file, which could potentially be used by the app developer. That's a bad practice and it's more difficult to do some things with. This PR changes to a separate shared preferences file and adds a migration, so we migrate all RC data from the previous shared preferences file to the new one. We won't delete the data from the previous shared preferences file, but that will remain unused.
### Description We migrated to a new shared preferences file in #2621, but we didn't update the integration tests to use the new file. This fixes those integration tests.
**This is an automatic release.** ## RevenueCat SDK ### 🐞 Bugfixes * Fix embedded font family loading (#2624) via Toni Rico (@tonidero) ### 🔄 Other Changes * Fix integration tests shared preferences file (#2629) via Toni Rico (@tonidero) * Migrate RC SharedPreferences data to a separate file (#2621) via Toni Rico (@tonidero) * Add annotation experimental library to debug builds (#2617) via Toni Rico (@tonidero) Co-authored-by: revenuecat-ops <ops@revenuecat.com>
Description
We were storing data in the default shared preferences file, which could potentially be used by the app developer. That's a bad practice and it's more difficult to do some things with. This PR changes to a separate shared preferences file and adds a migration, so we migrate all RC data from the previous shared preferences file to the new one. We won't delete the data from the previous shared preferences file, but that will remain unused.