Skip to content

[BC5] Make Activity first param in PurchaseParams#882

Merged
joshdholtz merged 1 commit into
bc5-supportfrom
bc5-support-make-activity-first-param-in-PurchaseParams
Mar 17, 2023
Merged

[BC5] Make Activity first param in PurchaseParams#882
joshdholtz merged 1 commit into
bc5-supportfrom
bc5-support-make-activity-first-param-in-PurchaseParams

Conversation

@joshdholtz

@joshdholtz joshdholtz commented Mar 16, 2023

Copy link
Copy Markdown
Member

Motivation

CF-1283

Might be good to move the Activity param as the first param in PurchaseParams to make things Android consistent (see comment here)

Description

  • Activity is now first param
  • Also fixed a flaky local test in EntitlementInfoTest that had nothing to do with this but I think was failing because of creating dates on my machine but weren't equal because milliseconds off? 🤷‍♂️

@joshdholtz joshdholtz requested review from beylmk and tonidero March 16, 2023 19:04
@joshdholtz joshdholtz changed the title Make Activity first param in PurchaseParams [BC5] Make Activity first param in PurchaseParams Mar 16, 2023
Comment on lines +21 to +23
private val oneDayAgo = 1.days.ago()
private val twoDaysAgo = 2.days.ago()
private val oneDayFromNow = 1.days.fromNow()

@joshdholtz joshdholtz Mar 16, 2023

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Dates are only created once now to prevent slightly off timestamps causing equal tests to fail

@codecov

codecov Bot commented Mar 16, 2023

Copy link
Copy Markdown

Codecov Report

Merging #882 (d243535) into bc5-support (3fdf928) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@               Coverage Diff               @@
##           bc5-support     #882      +/-   ##
===============================================
- Coverage        82.01%   81.99%   -0.02%     
===============================================
  Files              150      150              
  Lines             5349     5349              
  Branches           756      756              
===============================================
- Hits              4387     4386       -1     
  Misses             681      681              
- Partials           281      282       +1     
Impacted Files Coverage Δ
.../kotlin/com/revenuecat/purchases/PurchaseParams.kt 92.10% <100.00%> (ø)

... and 1 file 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.

@beylmk beylmk 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.

👍 looks good! we'll wanna remember to update v6 migration w this later..

@joshdholtz joshdholtz merged commit 96d0ecb into bc5-support Mar 17, 2023
@joshdholtz joshdholtz deleted the bc5-support-make-activity-first-param-in-PurchaseParams branch March 17, 2023 18:44
tonidero added a commit that referenced this pull request Mar 21, 2023
### Description
This fixes a flaky test in `EntitlementInfoTest`. Copied fix in #882 

Basically, we were creating multiple `EntitlementInfoTest` and comparing
them but the dates could be different which caused the test to fail.
@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants