Entitlement verification: Invalidate DeviceCache and ETag cache if verification mode enabled and cached value is NOT_REQUESTED#844
Conversation
There was a problem hiding this comment.
I was thinking about this for a while, and I think invalidating it on first configure should cover all cases, since when we logIn, we need a new CustomerInfo and we also delete the old cached CustomerInfo for the previous user.
I was also thinking about where this logic belongs to, and I thought that it fit well within the IdentityManager. Lmk if you had other ideas though!
There was a problem hiding this comment.
I like this, all combined in a single place 👍🏻
Codecov Report
@@ Coverage Diff @@
## entitlements-verification #844 +/- ##
=============================================================
+ Coverage 82.62% 82.66% +0.04%
=============================================================
Files 137 137
Lines 4501 4512 +11
Branches 587 589 +2
=============================================================
+ Hits 3719 3730 +11
Misses 562 562
Partials 220 220
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
a88f8d6 to
2c0b25f
Compare
There was a problem hiding this comment.
I'm doing this in iOS to validate if this abstraction makes sense (putting this in IdentityManager) have an improvement suggestion: you can call backend.clearCaches instead of injecting ETagManager here.
There was a problem hiding this comment.
And maybe instead of injecting the verification mode, we could expose it from Backend?
There was a problem hiding this comment.
Thanks for the suggestions! I liked them a lot so applied in fdb918a
There was a problem hiding this comment.
Curious about the difference here, why one is CamelCase and the other uppercase?
There was a problem hiding this comment.
VerificationResult is an enum and the convention is to use uppercases (though there is some discussion around that). While SignatureVerificationMode is a sealed class, so types of that sealed class are basically classes and should use CamelCase
…ion is enabled but cached `CustomerInfo` is not Android counterpart: RevenueCat/purchases-android#844
…d cached customer info is NOT_REQUESTED
4b42115 to
fdb918a
Compare
…ion is enabled but cached `CustomerInfo` is not Android counterpart: RevenueCat/purchases-android#844
…ion is enabled but cached `CustomerInfo` is not (#2330) Android counterpart: RevenueCat/purchases-android#844
…rification mode enabled and cached value is NOT_REQUESTED (#844) ### Description Completes [SDK-2896](https://linear.app/revenuecat/issue/SDK-2896/invalidate-devicecache-cache-if-entitlement-verification-is-missing). This PR will invalidate the `CustomerInfo` from the `DeviceCache` and the entire eTag cache if verification is enabled but the cached `CustomerInfo` verification result is `NOT_REQUESTED`.
Description
Completes SDK-2896.
This PR will invalidate the
CustomerInfofrom theDeviceCacheand the entire eTag cache if verification is enabled but the cachedCustomerInfoverification result isNOT_REQUESTED.