-
Notifications
You must be signed in to change notification settings - Fork 50
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
Use correct product context with DEFERRED
purchases
#1766
Conversation
@@ -92,7 +92,8 @@ internal class BillingWrapper( | |||
@Volatile | |||
var billingClient: BillingClient? = null | |||
|
|||
private val purchaseContext = mutableMapOf<String, PurchaseContext>() | |||
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) | |||
internal val purchaseContext = mutableMapOf<String, PurchaseContext>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing this using Google's callback was trickier, since we would need to use Jsons to create a google Purchase
object. This is easier and allows to verify this behavior.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1766 +/- ##
=======================================
Coverage 83.25% 83.26%
=======================================
Files 223 223
Lines 7614 7617 +3
Branches 1070 1071 +1
=======================================
+ Hits 6339 6342 +3
Misses 854 854
Partials 421 421 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense!
**This is an automatic release.** ### New Features * Add `DEFERRED` replacement mode (#1751) via Toni Rico (@tonidero) ### Bugfixes * Use correct product context with `DEFERRED` purchases (#1766) via Toni Rico (@tonidero) * Call callbacks on `DEFERRED` purchases (#1764) via Toni Rico (@tonidero) ### Dependency Updates * Bump fastlane from 2.221.0 to 2.221.1 (#1758) via dependabot[bot] (@dependabot[bot]) ### Other Changes * Adds .aiexclude (#1762) via JayShortway (@JayShortway) Co-authored-by: revenuecat-ops <[email protected]>
Description
Another followup to #1751 and #1764
When making
DEFERRED
purchases, Google returns the result using the old product id. We need to cache all the context information using the old product id so we can attribute it correctly.