Skip to content
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

[Trusted Entitlements] Do not clear CustomerInfo upon enabling Trusted Entitlements #4671

Merged

Conversation

tonidero
Copy link
Contributor

Description

Until now, when devs enabled Trusted Entitlements, we would clear the cached CustomerInfo and customers would need to refetch the latest value from the server, which could potentially cause delays and/or losing access temporarily.

With this PR, we won't be clearing the cached CustomerInfo anymore. Instead, we would return the cached customer info, which will have a VerificationResult of NOT_REQUESTED.

iOS equivalent of RevenueCat/purchases-android#2049

  • Update docs

@tonidero tonidero force-pushed the keep-unverified-customer-info-upon-enabling-trusted-entitlements branch from 3c66118 to eebd5fe Compare January 15, 2025 12:29
@tonidero tonidero marked this pull request as ready for review January 15, 2025 15:59
@tonidero tonidero requested a review from a team January 15, 2025 15:59
Copy link
Member

@JayShortway JayShortway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just a comment on naming consistency.

case .invalidating_cached_customer_info:
return "Detected unverified cached CustomerInfo but verification is enabled. Invalidating cache."
case .invalidating_http_cache:
return "Detected unverified cached CustomerInfo but verification is enabled. Invalidating HTTP cache."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're calling this ETag cache in Android, also in public logs. Ideally we're consistent both publicly and internally, but at least publicly imo 😄

@tonidero tonidero merged commit 511ed4a into main Jan 16, 2025
10 checks passed
@tonidero tonidero deleted the keep-unverified-customer-info-upon-enabling-trusted-entitlements branch January 16, 2025 15:48
This was referenced Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants