Avoid syncing attributes for users with blank user ids#755
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## main #755 +/- ##
=======================================
Coverage 81.50% 81.50%
=======================================
Files 120 120
Lines 3984 3984
Branches 509 510 +1
=======================================
Hits 3247 3247
Misses 534 534
Partials 203 203
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
aboedo
approved these changes
Jan 25, 2023
| obtainingDeviceIdentifiersObservable.waitUntilIdle { | ||
| val unsyncedStoredAttributesForAllUsers = | ||
| deviceCache.getUnsyncedSubscriberAttributes() | ||
| deviceCache.getUnsyncedSubscriberAttributes().filterKeys { it.isNotBlank() } |
Member
There was a problem hiding this comment.
let's add a comment explaining the need for this filter and pointing to this PR
aboedo
reviewed
Jan 25, 2023
This was referenced Jan 25, 2023
NachoSoto
added a commit
that referenced
this pull request
Jan 25, 2023
**This is an automatic release.** ### New Features * Add `Purchases.logLevel` and deprecate `Purchases.debugLogsEnabled` (#753) via NachoSoto (@NachoSoto) ### Bugfixes * Avoid syncing attributes for users with blank user ids (#755) via Toni Rico (@tonidero) ### Other Changes * Fixed Readme.MD (#727) via AristiDevs (@ArisGuimera) * Add codecov (#750) via Cesar de la Vega (@vegaro) * Update AGP to 7.4.0 (#747) via Cesar de la Vega (@vegaro) * Add test coverage using Kover (#748) via Cesar de la Vega (@vegaro) Co-authored-by: revenuecat-ops <ops@revenuecat.com> Co-authored-by: Cesar de la Vega <cesarvegaro@gmail.com> Co-authored-by: NachoSoto <ignaciosoto90@gmail.com>
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
Attempt at dealing with CSDK-531
Back in #384, we added checks to make sure we don't allow blank user ids. However, before that was added, user ids could be empty and could have subscriber attributes. Those could remain in SharedPreferences unless users uninstall which could cause some issues when syncing user attributes.
This is an attempt of solving that issue by just ignoring those old user ids when syncing subscriber attributes.