Skip to content

fix(godot): rebuild debug aar in make android - #277

Merged
hyochan merged 1 commit into
mainfrom
fix/godot-stale-debug-aar
Aug 3, 2026
Merged

hyochan merged 1 commit into
mainfrom
fix/godot-stale-debug-aar

Conversation

@hyochan

@hyochan hyochan commented Aug 3, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #276, closing the two verification gaps it reported.

The bug

make export-android exports with --export-debug, and the export plugin
embeds GodotIap.debug.aar for debug exports (godot_iap_plugin.gd
_get_android_libraries). But make android only ran
copyReleaseAarToAddons, so every debug export shipped whatever debug AAR
happened to be lying around
— three weeks stale when 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 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 android now runs copyDebugAarToAddons copyReleaseAarToAddons, and the
tracked GodotIap.debug.aar is rebuilt from current source. The release AAR
byte-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_error like the non-iOS path. It drives the real
restore_purchases() through the immediate-payload iOS fake; removing the
production emit makes it fail (expected: 1, got: 0), so it guards the
contract instead of restating it. godot suite: 448 tests, 0 failed.

Device verification (Pixel 2, real Play catalog)

Step Before After
initConnection fails in 3 ms, no logs true
get_available_purchases_result unreachable decodes 1 real Play purchase
fetchProducts unreachable returns all 5 products
Game state Connecting… forever Ready

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved iOS purchase restoration error handling, preserving native error codes and messages.
    • Added coverage for failed restore scenarios.
  • Build Improvements

    • Refreshed the Android debug plugin artifact so debug exports use the latest build.

`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>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@hyochan hyochan added godot-iap godot-iap library 👷‍♀️ build Build issue 🛠 bugfix All kinds of bug fixes 🤖 android Related to android labels Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

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

Changes

iOS restore failure coverage

Layer / File(s) Summary
Fake restore response and failure test
libraries/godot-iap/Example/tests/test_envelope_parsing.gd
The fake iOS plugin returns configurable restore responses. The test suite verifies failed restoration status and preserved native error code and message.

Android debug AAR update

Layer / File(s) Summary
Debug AAR build and bundled artifact
libraries/godot-iap/Makefile, libraries/godot-iap/addons/godot-iap/android/GodotIap.debug.aar
The Android build copies both debug and release AAR outputs. The bundled debug AAR contains a replacement classes.jar payload.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • hyodotdev/openiap#276: Adds related Godot failure-handling work extended here with iOS restore-failure coverage.

Suggested labels: ⌚️ regression, 🧪 test

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: rebuilding and copying the Godot Android debug AAR through make android.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/godot-stale-debug-aar

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

🧹 Nitpick comments (1)
libraries/godot-iap/Example/tests/test_envelope_parsing.gd (1)

574-616: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Make the restore-failure fake use the native async protocol.

FakeImmediateIOSPlugin.restorePurchases() returns a terminal payload without a requestId, so this only covers the immediate fallback path. restorePurchases() in the native plugin returns a pending envelope, signals purchase_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 one purchase_error with 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

📥 Commits

Reviewing files that changed from the base of the PR and between 791cd44 and c2275c2.

📒 Files selected for processing (3)
  • libraries/godot-iap/Example/tests/test_envelope_parsing.gd
  • libraries/godot-iap/Makefile
  • libraries/godot-iap/addons/godot-iap/android/GodotIap.debug.aar

@hyochan
hyochan merged commit 9fd4384 into main Aug 3, 2026
13 checks passed
@hyochan
hyochan deleted the fix/godot-stale-debug-aar branch August 3, 2026 18:16
@coderabbitai coderabbitai Bot mentioned this pull request Aug 17, 2026
9 of 10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖 android Related to android 🛠 bugfix All kinds of bug fixes 👷‍♀️ build Build issue godot-iap godot-iap library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant