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

[Woo POS] Crash when multiple connection flows are started and cancelled #12028

Open
malinajirka opened this issue Jul 16, 2024 · 1 comment
Open
Labels
feature: point of sale POS project type: bug A confirmed bug.

Comments

@malinajirka
Copy link
Contributor

malinajirka commented Jul 16, 2024

Describe the bug
When I click on the 'Collect payment' button multiple times, the app starts multiple card reader connection flows => when I attempt to cancel them, the app sometimes crash.

To Reproduce
Steps to reproduce the behavior:

  1. Go to More Menu -> POS
  2. Add a product
  3. Tap on 'Checkout'
  4. Tap on 'Collect Payment' multiple times within a short timespan
  5. Tap on cancel -> notice the app sometimes crashes.

Expected behavior
Multiple clicks on the collect payment button should still start only a single connection flow.

Logs

Process: com.woocommerce.android.prealpha, PID: 24752 java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=75952946, result=0, data=null} to activity {com.woocommerce.android.prealpha/com.woocommerce.android.ui.woopos.root.WooPosActivity}: java.lang.IllegalStateException: Already resumed, but proposed with update Failure at android.app.ActivityThread.deliverResults(ActivityThread.java:5323) at android.app.ActivityThread.handleSendResult(ActivityThread.java:5362) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67) at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7872) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) Caused by: java.lang.IllegalStateException: Already resumed, but proposed with update Failure at kotlinx.coroutines.CancellableContinuationImpl.alreadyResumedError(CancellableContinuationImpl.kt:559) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:524) at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:497) at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:368) at com.woocommerce.android.ui.woopos.cardreader.WooPosCardReaderFacade.onCreate$lambda$0(WooPosCardReaderFacade.kt:41) at com.woocommerce.android.ui.woopos.cardreader.WooPosCardReaderFacade.$r8$lambda$PgLUY3675ous7MehkdBsT19nqtg(Unknown Source:0) at com.woocommerce.android.ui.woopos.cardreader.WooPosCardReaderFacade$$ExternalSyntheticLambda0.onActivityResult(Unknown Source:4) at androidx.activity.result.ActivityResultRegistry.doDispatch(ActivityResultRegistry.java:414) at androidx.activity.result.ActivityResultRegistry.dispatchResult(ActivityResultRegistry.java:371) at androidx.activity.ComponentActivity.onActivityResult(ComponentActivity.java:845) at androidx.fragment.app.FragmentActivity.onActivityResult(FragmentActivity.java:151) at android.app.Activity.dispatchActivityResult(Activity.java:8628) at android.app.ActivityThread.deliverResults(ActivityThread.java:5316)
@malinajirka malinajirka added type: bug A confirmed bug. feature: point of sale POS project labels Jul 16, 2024
@dangermattic
Copy link
Collaborator

Thanks for reporting! 👍

@kidinov kidinov changed the title [POS] Crash when multiple connection flows are started and cancelled [Woo POS] Crash when multiple connection flows are started and cancelled Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: point of sale POS project type: bug A confirmed bug.
Projects
None yet
Development

No branches or pull requests

2 participants