Skip to content

Remove Parcelable implementation for classes with ProductDetails as a member#866

Merged
beylmk merged 5 commits into
bc5-supportfrom
fix-parcelization
Mar 14, 2023
Merged

Remove Parcelable implementation for classes with ProductDetails as a member#866
beylmk merged 5 commits into
bc5-supportfrom
fix-parcelization

Conversation

@beylmk

@beylmk beylmk commented Mar 10, 2023

Copy link
Copy Markdown
Contributor

Because ProductDetails does not have a public constructor, StoreProduct, Package, Offering, PurchasingData and Offerings are no longer Parcelable.

This PR takes away the implementation/annotation for those classes and updates unit tests accordingly. It also adds a missing test for StoreProduct, which caught a failure in parcelization. This is now fixed with the inner ComparableData class, copying the pattern we use in CustomerInfo to exclude the JSONObject.

@beylmk beylmk added the pr:breaking Changes that are breaking label Mar 10, 2023
@beylmk beylmk force-pushed the fix-parcelization branch from 1916f40 to c498c21 Compare March 13, 2023 20:55
@codecov

codecov Bot commented Mar 13, 2023

Copy link
Copy Markdown

Codecov Report

Merging #866 (e875c17) into bc5-support (040ea6a) will increase coverage by 0.22%.
The diff coverage is 100.00%.

@@               Coverage Diff               @@
##           bc5-support     #866      +/-   ##
===============================================
+ Coverage        80.04%   80.27%   +0.22%     
===============================================
  Files              132      132              
  Lines             4771     4796      +25     
  Branches           664      666       +2     
===============================================
+ Hits              3819     3850      +31     
+ Misses             687      681       -6     
  Partials           265      265              
Impacted Files Coverage Δ
...nuecat/purchases/amazon/storeProductConversions.kt 80.64% <ø> (ø)
...rc/main/java/com/revenuecat/purchases/Offerings.kt 100.00% <ø> (ø)
.../src/main/java/com/revenuecat/purchases/Package.kt 100.00% <ø> (ø)
.../revenuecat/purchases/models/SubscriptionOption.kt 85.71% <ø> (ø)
...revenuecat/purchases/models/SubscriptionOptions.kt 61.76% <ø> (ø)
...ava/com/revenuecat/purchases/utils/productStubs.kt 83.56% <ø> (+6.34%) ⬆️
...src/main/java/com/revenuecat/purchases/Offering.kt 85.71% <100.00%> (ø)
.../revenuecat/purchases/models/GoogleStoreProduct.kt 76.19% <100.00%> (ø)
...uecat/purchases/models/GoogleSubscriptionOption.kt 100.00% <100.00%> (ø)
...om/revenuecat/purchases/models/StoreTransaction.kt 100.00% <100.00%> (ø)

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

@beylmk beylmk marked this pull request as ready for review March 13, 2023 22:26
@beylmk beylmk requested a review from a team March 13, 2023 22:26

@joshdholtz joshdholtz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good to me! 💪 LGTM

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

| `UpgradeInfo` | `PurchaseParams.Builder.oldProductId` and `PurchaseParams.Builder.googleProrationMode` |
| `ProductChangeCallback` | `PurchaseCallback` |

`Offering`, `Offerings`, `Package`, and `StoreProduct` are no longer Parcelable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 I do wonder if this should go to a different section in this doc... Maybe Breaking changes? I think this is ok thoug

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

josh and i are planning a whole revamp of this doc! stay tuned :)

})

assertThat(numCallbacks == 1)
assert(numCallbacks == 1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm I think the pattern we've been following is

Suggested change
assert(numCallbacks == 1)
assertThat(numCallbacks).isEqualTo(1)

@beylmk beylmk merged commit f1d01a7 into bc5-support Mar 14, 2023
@beylmk beylmk deleted the fix-parcelization branch March 14, 2023 14:08
@joshdholtz joshdholtz mentioned this pull request Mar 23, 2023
joshdholtz added a commit that referenced this pull request Mar 23, 2023
### Breaking Changes
* Rename `introTrial` to `introOffer` on `SubscriptionOptions` (#890)
via Josh Holtz (@joshdholtz)
* Use `rc-ignore-offer` instead of `rc-ignore-befault-offer` (#889) via
Josh Holtz (@joshdholtz)
* AmazonStoreProduct updates (#881) via beylmk (@beylmk)
* Remove Parcelable implementation for classes with ProductDetails as a
member (#866) via beylmk (@beylmk)
* Make Activity first param in PurchaseParams (#882) via Josh Holtz
(@joshdholtz)
### New Features
* Re-enable `observerMode` and `syncPurchases()` (#878) via Josh Holtz
(@joshdholtz)
### Bugfixes
* Re-add `price_string` header on postReceipt (#879) via Josh Holtz
(@joshdholtz)
### Other Changes
* Cleaning up some TODOs in the code (#883) via Josh Holtz (@joshdholtz)
* Amazon Offering Parsing (#824) via beylmk (@beylmk)
* Merge main ->  bc5-support 2023-03-15 (#875) via Toni Rico (@tonidero)
* Fix purchase tester navigation (#871) via beylmk (@beylmk)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:breaking Changes that are breaking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants