fix(godot): rebuild debug aar in make android - #277
Conversation
`make export-android` exports with --export-debug, and the export plugin embeds GodotIap.debug.aar for debug exports. `make android` only ran copyReleaseAarToAddons, so every debug export shipped whatever debug AAR was last built — three weeks stale at the point this was found. The stale glue was compiled against an older openiap-google ABI, so initConnection died during ART method verification before its first instruction: a 3ms failure with no Kotlin log at all, which successive diagnoses misread as a keystore mismatch and then a Play entitlement gap. make android now refreshes both AAR variants, and the shipped debug AAR is rebuilt from current source. Verified on a Pixel 2: initConnection returns true, the failure-aware get_available_purchases_result decodes a real Play purchase, and fetchProducts returns the full five-product catalog. Also add the iOS restore-failure regression test that was pending: a failed iOS restore must emit purchase_error like the non-iOS path, driven through the real restore_purchases() via the immediate-payload iOS fake. Removing the production emit makes the test fail, so it guards the contract rather than restating it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
📝 WalkthroughWalkthroughThe PR adds an iOS restore-failure integration test with configurable fake-plugin responses. It also updates the Android build target to copy debug and release AAR files and replaces the bundled debug AAR binary. ChangesiOS restore failure coverage
Android debug AAR update
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
libraries/godot-iap/Example/tests/test_envelope_parsing.gd (1)
574-616: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winMake the restore-failure fake use the native async protocol.
FakeImmediateIOSPlugin.restorePurchases()returns a terminal payload without arequestId, so this only covers the immediate fallback path.restorePurchases()in the native plugin returns a pending envelope, signalspurchase_error, and signals async failure. Make the fake return a pending response and complete it through the native callback path, then assert the failed result plus exactly onepurchase_errorwith the native error code and message.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@libraries/godot-iap/Example/tests/test_envelope_parsing.gd` around lines 574 - 616, Update test_ios_restore_failure_emits_purchase_error and its fake restorePurchases behavior to use the native async protocol: return a pending envelope with a request identifier, then complete the request through the native callback path. Await the resulting failure and assert the failed result, exactly one purchase_error emission, and preservation of the native error code and message; do not exercise the immediate-payload fallback path.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@libraries/godot-iap/Example/tests/test_envelope_parsing.gd`:
- Around line 574-616: Update test_ios_restore_failure_emits_purchase_error and
its fake restorePurchases behavior to use the native async protocol: return a
pending envelope with a request identifier, then complete the request through
the native callback path. Await the resulting failure and assert the failed
result, exactly one purchase_error emission, and preservation of the native
error code and message; do not exercise the immediate-payload fallback path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 858225e6-3c24-4f44-9515-da61130eef12
📒 Files selected for processing (3)
libraries/godot-iap/Example/tests/test_envelope_parsing.gdlibraries/godot-iap/Makefilelibraries/godot-iap/addons/godot-iap/android/GodotIap.debug.aar
Follow-up to #276, closing the two verification gaps it reported.
The bug
make export-androidexports with--export-debug, and the export pluginembeds
GodotIap.debug.aarfor debug exports (godot_iap_plugin.gd_get_android_libraries). Butmake androidonly rancopyReleaseAarToAddons, so every debug export shipped whatever debug AARhappened to be lying around — three weeks stale when this was found.
The stale glue was compiled against an older openiap-google ABI, so
initConnectiondied during ART method verification before its firstinstruction: a 3 ms failure with no Kotlin log line at all. That silence is
what #276 misreported first as a keystore mismatch and then as a Play
entitlement gap. Instrumented ctor/method-entry markers proved the freshly
built release AAR never reached the APK, which led to the debug/release split.
The fix
make androidnow runscopyDebugAarToAddons copyReleaseAarToAddons, and thetracked
GodotIap.debug.aaris rebuilt from current source. The release AARbyte-matches main, confirming the build is deterministic against the same
source.
Also included
The iOS restore-failure regression test #276 left uncovered: a failed iOS
restore must emit
purchase_errorlike the non-iOS path. It drives the realrestore_purchases()through the immediate-payload iOS fake; removing theproduction emit makes it fail (
expected: 1, got: 0), so it guards thecontract instead of restating it. godot suite: 448 tests, 0 failed.
Device verification (Pixel 2, real Play catalog)
initConnectiontrueget_available_purchases_resultfetchProductsConnecting…foreverReady🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Build Improvements