Refactor CustomerInfo listener and cache logic into CustomerInfoUpdater#1052
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1052 +/- ##
==========================================
- Coverage 85.76% 85.75% -0.01%
==========================================
Files 176 177 +1
Lines 6265 6284 +19
Branches 864 866 +2
==========================================
+ Hits 5373 5389 +16
- Misses 557 559 +2
- Partials 335 336 +1
|
There was a problem hiding this comment.
Honestly I'm not sure if this was the best name but I thought it was ok... I explained a bit in the comment for this class.
There was a problem hiding this comment.
I think it's fine, but if requires explanation maybe it's worth giving it another thought. I don't have a better idea, but it's true that updater makes it seem like it will fetch it
There was a problem hiding this comment.
I renamed it to CustomerInfoUpdateReceiver, what to you think?
There was a problem hiding this comment.
I am not convinced about the Receiver part, since it's also notifying. What about CustomerInfoUpdatesHandler?
There was a problem hiding this comment.
I like that, I renamed to the singular version of it CustomerInfoUpdateHandler in e9d41c1
2a4f9b1 to
a3172f6
Compare
There was a problem hiding this comment.
I think it's fine, but if requires explanation maybe it's worth giving it another thought. I don't have a better idea, but it's true that updater makes it seem like it will fetch it
53de5f0 to
7a6f2a5
Compare
### Description Followup to #1052 and #1058 This changes the behavior of fetching customer info. Now, when fetching customer info, we will first try to sync any pending purchases if any. If there are pending purchases, we will return the customer info from the last request sent. If there aren't, we will then hit the current customer info endpoint to get the latest customer info.
**This is an automatic release.** ### Bugfixes * Default customer info schema version to latest known by SDK (#1080) via Toni Rico (@tonidero) * Handle other diagnostics-related exceptions (#1076) via Toni Rico (@tonidero) * Return error in queryPurchases if error connecting to billing client (#1072) via Toni Rico (@tonidero) ### Other Changes * Fix offline entitlements integration tests (#1085) via Toni Rico (@tonidero) * Add defaultsRelease variant tests run configuration (#1074) via Toni Rico (@tonidero) * Compose sample app: move to gradle catalog (#1081) via Toni Rico (@tonidero) * Compose sample app: automate builds (#1082) via Toni Rico (@tonidero) * Compose sample app (#1056) via Toni Rico (@tonidero) * Migrate to Gradle version catalog (#1059) via Cesar de la Vega (@vegaro) * Trusted entitlements: Add logs with verification mode (#1067) via Toni Rico (@tonidero) * Sync pending purchases before getting customer info (#1073) via Toni Rico (@tonidero) * Refactor syncing pending transactions logic out of `Purchases` (#1058) via Toni Rico (@tonidero) * Refactor CustomerInfo listener and cache logic into CustomerInfoUpdater (#1052) via Toni Rico (@tonidero) * Trusted entitlements: Add integration tests (#1071) via Toni Rico (@tonidero) * Trusted entitlements: Add internal mechanism to force signing errors for tests (#1070) via Toni Rico (@tonidero) Co-authored-by: revenuecat-ops <ops@revenuecat.com>
Description
First part of SDK-3155
This PR refactors the customer info listener and caching logic out of CustomerInfoHelper and into CustomerInfoUpdater. This is in preparation of a future refactor to be able to refresh customer info by posting unsynced receipts.
There are no behavior changes in this PR.
The relevant dependencies look like this:
