adyen-react-native
adyen-react-native copied to clipboard
SessionHelper.hide got 1 arguments, expected 2
A crash was reported in production (via Crashlytics) related to SessionHelper.hide in the React Native Adyen Drop-in integration.
The crash message suggests a mismatch between the number of arguments passed from the JavaScript side and the parameters expected by the native module.
Crash log:
Fatal Exception: com.facebook.react.bridge.NativeArgumentsParseException: SessionHelper.hide got 1 arguments, expected 2
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:349)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:146)
at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.kt:20)
at android.os.Looper.loop(Looper.java:193)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion.startNewBackgroundThread$lambda$1(MessageQueueThreadImpl.kt:175)
at java.lang.Thread.run(Thread.java:764)
It seems that the native bridge expects two parameters, but the JS call might only be providing one. Since this was reported from production, I’m not sure under what conditions it happens.
To Reproduce Unfortunately, I haven’t been able to reproduce this locally. It was reported automatically via Crashlytics from a production build, so I don’t have exact reproduction steps. It likely occurs during or after a checkout session when the Drop-in UI is being dismissed.
Expected behavior
Ideally, SessionHelper.hide should not crash if it receives fewer arguments — or there should be clear documentation on how to call it correctly.
Screenshots N/A – crash occurs natively, no visible UI impact before crash.
Smartphone (please complete the following information):
- Device: Saturn1000F2 (multiple production devices)
- OS: Android (various versions)
- React Native version: 0.79.5
- Adyen Drop-in version: 2.8.0
Additional context
- The crash only appears in production (via Crashlytics).
- It’s unclear if the second parameter is meant to be optional.
- Would appreciate clarification on the expected arguments for
SessionHelper.hideor guidance on ensuring correct usage.
Hey @mtroskot
The SDK itself never call SessionHelper.hide. Only place where it can happen - network error during session request - SDK calls onError and pass SessionHelper as the "component".
We will look if there is a way to preventing this.
Thank you for feedback 💚
@descorp I'm pretty sure that this user had network error because of firewall config
same issue here, only for a few users. Maybe we are using it incorrectly, we call component.hide on adyen success and error
e.g.
success
const onAdyenComplete = (result: string, component: AdyenComponent) => {
LOG.debug('Adyen onComplete', result)
const resultBody = result as unknown as AydenResult
const success = resultBody.resultCode == 'Authorised'
component.hide(success)
if (success) {
handleSuccess()
} else {
handleError(resultBody.resultCode)
}
}
error
const onAdyenError = (error: AdyenError, component: AdyenComponent) => {
LOG.error('Adyen onError', error)
component.hide(false)
handleError(error.message, error.errorCode)
},
BTW we are using an old version 2.6.1, planning to upgrade soon
@ignaciotcrespo
Maybe we are using it incorrectly
If we assume it is the same issue, then bug is on our side.
SDK calls onError and provides component that unable to handle hide(_) with only one parameter.