Restore PHPBridge.kt API dropped in Jump merge (#111)#120
Merged
Conversation
Symptom: Android builds in apps using the firebase plugin (or any plugin
that drives the ephemeral PHP runtime) fail to compile against 3.3.0:
PushNotificationService.kt: Unresolved reference 'nativeEphemeralBoot'
PushNotificationService.kt: Unresolved reference 'nativeEphemeralArtisan'
PushNotificationService.kt: Unresolved reference 'nativeEphemeralShutdown'
WebViewManager.kt: Unresolved reference 'consumePostData'
Five public members existed in PHPBridge.kt as of 866a6dd (the Apr 4
Android POST-body fix) and are still required by current code:
- external fun nativeEphemeralBoot/Artisan/Shutdown — registered as JNI
methods in php_bridge.c:1354-1356 and called from plugin code such as
nativephp/mobile-firebase's PushNotificationService.
- storePostData(key, data) / consumePostData(key) — used by the bundled
WebViewManager.kt (lines 268, 272, 275, 531, 544, 547) to correlate
POST bodies stashed by the injected JS XHR/fetch hook with the
intercepted request on the native side.
The Jump merge (#111, commit 026a1b7) accidentally dropped these
declarations from PHPBridge.kt while leaving the JNI registrations and
all callers in place. Restored verbatim from the canonical
jump-playground copy that Jump itself runs against, including the 50 ms
wait loop on consumePostData that #84 added to handle the race where the
WebView fires the network request before the injected JS hook has
finished stashing the body — important for concurrent Livewire $wire
bursts to the same endpoint.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Fixes the 3.3.0 regression where Android builds fail to compile in apps using the firebase plugin (or any plugin that drives the ephemeral PHP runtime):
Five public members existed in
PHPBridge.ktas of866a6dd(the Apr 4 Android POST-body fix) and are still required by current code:external fun nativeEphemeralBoot/Artisan/Shutdown— registered as JNI methods inphp_bridge.c:1354-1356and called from plugin code such asnativephp/mobile-firebase'sPushNotificationService.storePostData(key, data)/consumePostData(key)— used by the bundledWebViewManager.kt(lines 268, 272, 275, 531, 544, 547) to correlate POST bodies stashed by the injected JS XHR/fetch hook with the intercepted request on the native side.The Jump merge (#111, commit
026a1b7) accidentally dropped these declarations fromPHPBridge.ktwhile leaving the JNI registrations and all callers in place. Restored verbatim from the canonical jump-playground copy that Jump itself runs against, including the 50 ms wait loop onconsumePostDatathat #84 added to handle the race where the WebView fires the network request before the injected JS hook has finished stashing the body — important for concurrent Livewire\$wirebursts to the same endpoint.Test plan
nativephp/mobile-firebase(or any plugin invoking the ephemeral runtime) — confirm compile succeeds\$wirecalls to the same endpoint — confirm none drop the body (50 ms wait loop covers JS-stash race)🤖 Generated with Claude Code