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

Added ENTITLEMENTS_COMPUTED_ON_DEVICE #939

Merged
merged 2 commits into from
Apr 10, 2023
Merged

Conversation

vegaro
Copy link
Contributor

@vegaro vegaro commented Apr 4, 2023

Used for entitlements computed directly with data from BillingClient

The name of the enum is open to feedback and it's being discussed here

@vegaro vegaro added the feat A new feature label Apr 4, 2023
@vegaro vegaro requested a review from a team April 4, 2023 10:13
@codecov
Copy link

codecov bot commented Apr 4, 2023

Codecov Report

Merging #939 (49d3794) into main (82e7c20) will decrease coverage by 0.42%.
The diff coverage is 92.24%.

❗ Current head 49d3794 differs from pull request most recent head a4770f9. Consider uploading reports for the commit a4770f9 to get more accurate results

@@            Coverage Diff             @@
##             main     #939      +/-   ##
==========================================
- Coverage   85.07%   84.66%   -0.42%     
==========================================
  Files         165      163       -2     
  Lines        5824     5622     -202     
  Branches      801      780      -21     
==========================================
- Hits         4955     4760     -195     
- Misses        550      560      +10     
+ Partials      319      302      -17     
Impacted Files Coverage Δ
...ain/java/com/revenuecat/purchases/common/errors.kt 75.92% <ø> (ø)
...evenuecat/purchases/strings/CustomerInfoStrings.kt 0.00% <ø> (ø)
...flineentitlements/OfflineCustomerInfoCalculator.kt 90.00% <90.00%> (-1.18%) ⬇️
...on/offlineentitlements/PurchasedProductsFetcher.kt 91.17% <91.17%> (ø)
...ses/common/offlineentitlements/PurchasedProduct.kt 100.00% <100.00%> (ø)
...otlin/com/revenuecat/purchases/PurchasesFactory.kt 78.78% <100.00%> (ø)
...m/revenuecat/purchases/utils/billingClientStubs.kt 97.10% <100.00%> (ø)
...ava/com/revenuecat/purchases/VerificationResult.kt 100.00% <100.00%> (ø)

... and 21 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -49,7 +49,7 @@ class OfflineCustomerInfoCalculator(
}

val customerInfo = CustomerInfoFactory.buildCustomerInfo(
jsonObject, requestDate, VerificationResult.NOT_REQUESTED
jsonObject, requestDate, VerificationResult.ENTITLEMENTS_COMPUTED_ON_DEVICE
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

/**
* Entitlements were computed on device.
*/
ENTITLEMENTS_COMPUTED_ON_DEVICE
Copy link
Contributor

Choose a reason for hiding this comment

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

I had some doubts about the correct preposition to use here (on vs in). So I asked ChatGTP, it's clear now :P
image

@NachoSoto
Copy link
Contributor

I commented about this on the iOS PR: I wouldn't include the word "entitlements" on this type, since we originally thought of this type so it can represent any verification.

Base automatically changed from cesar/sdk-2988-compute-customerinfo-from-a-list-of to main April 5, 2023 08:02
@vegaro vegaro force-pushed the cesar/sdk-3035-verified-offline branch from 49d3794 to a4770f9 Compare April 10, 2023 13:48
@vegaro vegaro merged commit 95fe4fa into main Apr 10, 2023
@vegaro vegaro deleted the cesar/sdk-3035-verified-offline branch April 10, 2023 14:11
tonidero added a commit that referenced this pull request May 18, 2023
**This is an automatic release.**

### New Features
* CAT-859 Expose whether or not a SubscriptionOption is Prepaid in the
SDK (#1005) via Deema AlShamaa (@dalshamaa)
### Bugfixes
* [CF-1324] Fix personalizedPrice defaulting to false (#952) via beylmk
(@beylmk)
### Performance Improvements
* Store and return ETag last refresh time header (#978) via Toni Rico
(@tonidero)
### Dependency Updates
* Bump fastlane-plugin-revenuecat_internal from `3b03efa` to `fe45299`
(#991) via dependabot[bot] (@dependabot[bot])
* Bump danger from 9.2.0 to 9.3.0 (#981) via dependabot[bot]
(@dependabot[bot])
* Bump fastlane-plugin-revenuecat_internal from `8482a43` to `3b03efa`
(#974) via dependabot[bot] (@dependabot[bot])
* Bump fastlane from 2.212.1 to 2.212.2 (#973) via dependabot[bot]
(@dependabot[bot])
* Bump fastlane-plugin-revenuecat_internal from `9255366` to `8482a43`
(#961) via dependabot[bot] (@dependabot[bot])
### Other Changes
* Add proration modes to post to backend (#977) via swehner (@swehner)
* Added ENTITLEMENTS_COMPUTED_ON_DEVICE (#939) via Cesar de la Vega
(@vegaro)
* Fix flaky test in OfflineCustomerInfoCalculatorTest (#997) via Cesar
de la Vega (@vegaro)
* Fix `OfflineCustomerInfoCalculatorTest` `Unresolved reference:
ProducType` (#995) via Cesar de la Vega (@vegaro)
* Add support for product_plan_identifier for offline customer info
(#959) via Cesar de la Vega (@vegaro)
* Add non-subscriptions support to offline customer info (#958) via
Cesar de la Vega (@vegaro)
* Query only active purchases when generating offline entitlements
customer info (#1003) via Toni Rico (@tonidero)
* Fix `PurchasesIntegrationTest` building issue (#996 into main) (#998)
via Cesar de la Vega (@vegaro)
* Fail offline entitlements computation if product entitlement mapping
not available (#999) via Toni Rico (@tonidero)
* Fix  build_magic_weather lane (#993) via Cesar de la Vega (@vegaro)
* Add backend integration tests and test product entitlement mapping
endpoint (#988) via Toni Rico (@tonidero)
* Fix purchases integration tests (#980) via Toni Rico (@tonidero)
* Disable offline entitlements if active inapp purchases exist (#983)
via Toni Rico (@tonidero)
* Clear cached customer info upon entering offline entitlements mode
(#989) via Toni Rico (@tonidero)
* Update product entitlement mapping request to new format (#976) via
Toni Rico (@tonidero)
* Support enabling/disabling offline entitlements (#964) via Toni Rico
(@tonidero)
* Add back integration tests automation (#972) via Toni Rico (@tonidero)
* Upgrade to AGP 8.0 (#975) via Toni Rico (@tonidero)
* Extract post receipt logic to PostReceiptHelper (#967) via Toni Rico
(@tonidero)
* Add isServerDown to error callback for postReceipt and getCustomerInfo
requests (#963) via Toni Rico (@tonidero)
* Add back integration test flavors (#962) via Toni Rico (@tonidero)
* Fix storing test results (#966) via Cesar de la Vega (@vegaro)
* Extract detekt job from test job (#965) via Cesar de la Vega (@vegaro)


[CF-1324]:
https://revenuecats.atlassian.net/browse/CF-1324?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: revenuecat-ops <ops@revenuecat.com>
Co-authored-by: Toni Rico <antonio.rico.diez@revenuecat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants