Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition to access hyperwallet through AddTransferMethodActivity when using com.hyperwallet.android.ui:transfermethodui:1.0.0-beta12" #289

Open
Syrou opened this issue Jan 20, 2023 · 2 comments

Comments

@Syrou
Copy link

Syrou commented Jan 20, 2023

Your own code does not seem to wait for the getHyperwallet to get initilized. This happening frequently on budget phones
on various brands. Please add waiting mechanism to your code. Ping @grmeyer-hw-dev

Fatal Exception: java.lang.RuntimeException: Unable to resume activity {io.asdf.android/com.hyperwallet.android.ui.transfermethod.view.AddTransferMethodActivity}: com.hyperwallet.android.exception.HyperwalletInitializationException: The Hyperwallet Core SDK has not yet been initialized
       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4916)
       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4953)
       at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2328)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:246)
       at android.app.ActivityThread.main(ActivityThread.java:8633)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

Caused by com.hyperwallet.android.exception.HyperwalletInitializationException: The Hyperwallet Core SDK has not yet been initialized
       at com.hyperwallet.android.Hyperwallet.getDefault(Hyperwallet.java:167)
       at com.hyperwallet.android.ui.transfermethod.repository.TransferMethodConfigurationRepositoryImpl.getHyperwallet(TransferMethodConfigurationRepositoryImpl.java:71)
       at com.hyperwallet.android.ui.transfermethod.repository.TransferMethodConfigurationRepositoryImpl.getTransferMethodConfigurationFieldResult(TransferMethodConfigurationRepositoryImpl.java:138)
       at com.hyperwallet.android.ui.transfermethod.repository.TransferMethodConfigurationRepositoryImpl.getFields(TransferMethodConfigurationRepositoryImpl.java:189)
       at com.hyperwallet.android.ui.transfermethod.view.AddTransferMethodPresenter.loadTransferMethodConfigurationFields(AddTransferMethodPresenter.java:89)
       at com.hyperwallet.android.ui.transfermethod.view.AddTransferMethodFragment.onResume(AddTransferMethodFragment.java:258)
       at androidx.fragment.app.Fragment.performResume(Fragment.java:3180)
       at androidx.fragment.app.FragmentStateManager.resume(FragmentStateManager.java:606)
       at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:285)
       at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:113)
       at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1424)
       at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2968)
       at androidx.fragment.app.FragmentManager.dispatchResume(FragmentManager.java:2900)
       at androidx.fragment.app.FragmentController.dispatchResume(FragmentController.java:285)
       at androidx.fragment.app.FragmentActivity.onResumeFragments(FragmentActivity.java:334)
       at androidx.fragment.app.FragmentActivity.onPostResume(FragmentActivity.java:323)
       at androidx.appcompat.app.AppCompatActivity.onPostResume(AppCompatActivity.java:242)
       at android.app.Activity.performResume(Activity.java:8378)
       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4906)
       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4953)
       at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2328)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:246)
       at android.app.ActivityThread.main(ActivityThread.java:8633)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

@grmeyer-hw-dev
Copy link
Collaborator

grmeyer-hw-dev commented Jan 20, 2023

Hey @Syrou

Thanks for report this issue, I just have few question to repro this issue:

  • Could you list few devices this issues is happening ?
  • How are you invoking the AddTransferMethodActivity? I want to repro the issue

@Syrou
Copy link
Author

Syrou commented Jan 20, 2023

Top crashing devices:
Samsung Galaxy A2 Core
Samsung Galaxy A32
Samsung Galaxy On5

OPPO F11 Pro
OPPO A5 2020

XIAOMI Redmi 9C NFC
XIAOMI Redmi 9
XIAOMI Redmi Note 9

This happens without us even invoking AddTransferMethodActivity explicitly. We only invoke val intent = hyperwalletTransferMethodUi.getIntentSelectTransferMethodActivity(requireActivity(), true)
startActivity(intent) on a button press specifically.

It should be noted that this happens within 1 second of app start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants