fix: surface native errors from GetCurrentOfferingForPlacement - #1019
Merged
Conversation
vegaro
force-pushed
the
cesar/fix-placement-offering-error
branch
from
August 6, 2026 11:07
de08f83 to
4e9e038
Compare
vegaro
marked this pull request as ready for review
August 6, 2026 11:24
vegaro
force-pushed
the
cesar/fix-placement-offering-error
branch
from
August 6, 2026 12:49
4e9e038 to
cabf3f1
Compare
Both native wrappers send only an "error" key when the offerings fetch fails —
there is no "offering" key in that payload. The receiver tested for a missing
"offering" before checking for an error, so it returned early with
callback(null, null) and the error never reached the caller. A network failure
was indistinguishable from "no offering is configured for this placement".
Checking for the error first fixes that. The no-offering case is unchanged: both
wrappers send "{}" there, which still falls through to callback(null, null).
Co-Authored-By: Claude <noreply@anthropic.com>
vegaro
force-pushed
the
cesar/fix-placement-offering-error
branch
from
August 6, 2026 13:40
cabf3f1 to
c72bdc7
Compare
RCGitBot
added a commit
that referenced
this pull request
Aug 13, 2026
**This is an automatic release.** ## RevenueCat SDK ### ✨ New Features * feat(ads): expose reward verification primitives (#971) via Peter Porfy (@peterporfy) ### 🐞 Bugfixes * Stop sending the purchase response twice on iOS errors (#1042) via Cesar de la Vega (@vegaro) * fix: surface native errors from GetCurrentOfferingForPlacement (#1019) via Cesar de la Vega (@vegaro) ### 📦 Dependency Updates * [AUTOMATIC BUMP] Updates purchases-hybrid-common to 18.30.0 (#1046) via RevenueCat Git Bot (@RCGitBot) * [Android 10.16.1](https://github.com/RevenueCat/purchases-android/releases/tag/10.16.1) * [iOS 5.83.1](https://github.com/RevenueCat/purchases-ios/releases/tag/5.83.1) ### 🔄 Other Changes * feat(ads): ad reward sample app (#1045) via Peter Porfy (@peterporfy) * test: cover custom paywall tracking, ad tracker, and model parsing (#1013) via Cesar de la Vega (@vegaro) * test: cover missing Purchases functions (#1012) via Cesar de la Vega (@vegaro) * Bump fastlane-plugin-revenuecat_internal from `b4e1e7f` to `7fbbe66` (#1040) via dependabot[bot] (@dependabot[bot]) * Bump fastlane-plugin-revenuecat_internal from `dd577ee` to `b4e1e7f` (#1038) via dependabot[bot] (@dependabot[bot]) * Bump fastlane-plugin-revenuecat_internal from `3421c88` to `dd577ee` (#1036) via dependabot[bot] (@dependabot[bot]) * Bump danger from 9.6.0 to 9.6.1 (#1035) via dependabot[bot] (@dependabot[bot]) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches iOS purchase callback behavior and offerings/placement error paths, plus new ads reward-verification APIs backed by a native SDK bump. > > **Overview** > This **automatic release** cuts **9.8.0** by bumping package/plugin versions (`.version`, `package.json`, Android/iOS `PLUGIN_VERSION`) and publishing **CHANGELOG** / **VERSIONS.md** for **purchases-hybrid-common 18.30.0** (iOS **5.83.1**, Android **10.16.1**). > > Shipped in this version (from prior merges, summarized in the changelog): **ad reward verification** primitives (`generateRewardVerificationToken` / `pollRewardVerification` on the native bridge), fixes so **iOS purchase errors** no longer emit the purchase callback twice, and **GetCurrentOfferingForPlacement** now surfaces native failures instead of swallowing them. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a2f2846. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
GetCurrentOfferingForPlacementcould never report a failure. Both native wrappers send only anerrorkey when the offerings fetch fails — there is noofferingkey in that payload — but_getCurrentOfferingForPlacementtested for a missingofferingfirst and returned early withcallback(null, null). The error was dropped, so a network failure looked exactly like "no offering is configured for this placement".Moving the error check ahead of the missing-offering guard fixes it.
Base branch
Stacked on
cesar/unity-callback-response-tests(#1012), which adds the test file this builds on.Note
Medium Risk
Changes callback semantics for placement offerings on the Unity bridge; apps that relied on
(null, null)for failures may need to handleError, but the fix aligns behavior with other offerings APIs and is covered by tests.Overview
GetCurrentOfferingForPlacementnow forwards native failures to the app callback instead of treating them like an empty placement.In
_getCurrentOfferingForPlacement,ResponseHasErrorruns before the missing-offeringguard. On failure, iOS/Android only send anerrorkey (nooffering), so the old order always invokedcallback(null, null)and hid network and other errors.The edit-mode test
GetCurrentOfferingForPlacementDeliversNativeErrornow expects a populatedError(e.g. code 10,NETWORK_ERROR) instead of documenting dropped errors.Reviewed by Cursor Bugbot for commit c72bdc7. Bugbot is set up for automated code reviews on this repo. Configure here.