Skip to content

Fix purchase callback not firing for DEFERRED product changes with baePlanId in oldProductId#2937

Merged
tonidero merged 1 commit into
mainfrom
git-261-purchase-callback-never-fires-when-changing-products-with
Dec 16, 2025
Merged

Fix purchase callback not firing for DEFERRED product changes with baePlanId in oldProductId#2937
tonidero merged 1 commit into
mainfrom
git-261-purchase-callback-never-fires-when-changing-products-with

Conversation

@facumenzella

Copy link
Copy Markdown
Member

Motivation

Fixes an issue where the purchase callback would never fire when performing a product change using GoogleReplacementMode.DEFERRED if the oldProductId contained a base plan ID suffix (e.g., "productId:basePlanId").

Addresses #2874

Description

Root Cause

When using DEFERRED proration mode:

  1. The callback was stored using the raw oldProductId (which could include :basePlanId)
  2. Google Play returns a transaction containing only the product ID (without base plan)
  3. The callback lookup failed because "productId""productId:basePlanId"

@facumenzella facumenzella requested a review from a team as a code owner December 15, 2025 17:37
@facumenzella facumenzella added the pr:fix A bug fix label Dec 15, 2025

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

Amazing! Makes sense, and thanks for the fix!!

@codecov

codecov Bot commented Dec 16, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.82%. Comparing base (62b2f26) to head (7151887).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2937   +/-   ##
=======================================
  Coverage   78.82%   78.82%           
=======================================
  Files         337      337           
  Lines       13126    13129    +3     
  Branches     1770     1771    +1     
=======================================
+ Hits        10346    10349    +3     
  Misses       2038     2038           
  Partials      742      742           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@facumenzella facumenzella added this pull request to the merge queue Dec 16, 2025
@tonidero tonidero removed this pull request from the merge queue due to a manual request Dec 16, 2025
@tonidero tonidero merged commit e5804d9 into main Dec 16, 2025
22 of 23 checks passed
@tonidero tonidero deleted the git-261-purchase-callback-never-fires-when-changing-products-with branch December 16, 2025 09:53
This was referenced Dec 17, 2025
tonidero added a commit that referenced this pull request Dec 18, 2025
## RevenueCat SDK
### ✨ New Features
* Adds `setAppsFlyerConversionData` to conveniently track AppsFlyer
conversion data (#2931) via JayShortway (@JayShortway)
### 🐞 Bugfixes
* Make close() method also clear the shared instance of the SDK (#2940)
via Toni Rico (@tonidero)
* Fix purchase callback not firing for DEFERRED product changes with
baePlanId in oldProductId (#2937) via Facundo Menzella (@facumenzella)

### 🔄 Other Changes
* [AUTOMATIC] Update golden test files for backend integration tests
(#2949) via RevenueCat Git Bot (@RCGitBot)
* [AUTOMATIC] Update golden test files for backend integration tests
(#2944) via RevenueCat Git Bot (@RCGitBot)
* Adds `.kotlin` to `.gitignore` (#2941) via JayShortway (@JayShortway)
* Dont use reflection to instantiate AmazonOfferingParser (#2934) via
Will Taylor (@fire-at-will)

---------

Co-authored-by: revenuecat-ops <ops@revenuecat.com>
Co-authored-by: Toni Rico <toni.rico.diez@revenuecat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants