Get offerings response from disk cache if available#1029
Conversation
There was a problem hiding this comment.
Hopefully we can start improving our integration test suite slowly 😊
Codecov Report
@@ Coverage Diff @@
## main #1029 +/- ##
==========================================
- Coverage 85.51% 85.51% -0.01%
==========================================
Files 175 175
Lines 6111 6116 +5
Branches 855 856 +1
==========================================
+ Hits 5226 5230 +4
- Misses 549 550 +1
Partials 336 336
|
NachoSoto
left a comment
There was a problem hiding this comment.
Just one question about the type of errors we handle.
There was a problem hiding this comment.
In iOS I'm only doing this for "server is down" errors FWIW. I don't think this is bad but might want to keep the behavior the same?
There was a problem hiding this comment.
Hmm right... I do think we can just use cached offerings for other types of errors... But we can discuss that further and be minimal for now. Will do the change 👍
NachoSoto
left a comment
There was a problem hiding this comment.
Just one question about the type of errors we handle.
076228d to
e767e1c
Compare
1c7d62a to
ac64e3b
Compare
|
@NachoSoto I added that change to only use the cached offerings on server errors. Going to merge this but lmk if you have any further comments on those changes and can address them on new PRs |
**This is an automatic release.** ### New Features * Offline entitlements support (#1030) via Toni Rico (@tonidero) ### Bugfixes * Fix billing connection error when querying purchases early in the process lifetime (#1032) via Toni Rico (@tonidero) ### Performance Improvements * Perform product entitlement mapping request after more critical requests (#1017) via Toni Rico (@tonidero) ### Dependency Updates * Bump fastlane from 2.212.2 to 2.213.0 (#1024) via dependabot[bot] (@dependabot[bot]) ### Other Changes * Get offerings response from disk cache if available (#1029) via Toni Rico (@tonidero) * Improve offline entitlements logs to mention limitations of this mode (#1039) via Toni Rico (@tonidero) * Improve error message when backend returns internal error code (#1038) via Toni Rico (@tonidero) * PurchaseTester: Add new UI to configure internal proxy behavior (#1016) via Toni Rico (@tonidero) * Updated readme to include links to migration guides (#1021) via Marcos Castany (@mcastany) * Store offerings response in SharedPreferences (#1028) via Toni Rico (@tonidero) * Refactor offerings code out of Purchases (#1027) via Toni Rico (@tonidero) --------- Co-authored-by: revenuecat-ops <ops@revenuecat.com> Co-authored-by: Toni Rico <antonio.rico.diez@revenuecat.com>
Description
Third and final part of persisting offerings in disk to make the system more robust. In this final PR, we use the offerings response cached in #1028 so, in case of a backend error getting offerings, we can calculate the offerings (as long as Play store/Amazon store still give us the product information) as long as we have cached the value before.