braintree / braintree-android-drop-in

Braintree Drop-In SDK for Android
https://developers.braintreepayments.com/guides/drop-in/android/v2
MIT License
124 stars 78 forks source link

Possible drop-in not closed issue with Android 9/10 #411

Open mionescu95 opened 1 year ago

mionescu95 commented 1 year ago

Integration Details (please complete the following information):

Describe the bug Hello. We recently upgraded from 5.4.0 to 6.8.0 the braintree drop-in and we have this strange behavior when deploying the app to an Android 9 and 10 emulator/device. We are starting the drop-in normally as in the examples and we introduce the card details and OTP and after that, the OTP screen disappears but the drop-in card selection screen stays up until we click elsewhere and no callback is fired until closed. We tested on devices with Android 9, 10, 11, 12 and 13, only on the 9 and 10 reproduces.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Credit or Debit Card'
  2. Input all card information
  3. Enter OTP Pass
  4. Wait for drop-in to close but not closing

Expected behavior On newer android versions, the drop-in closes gracefully and returns fires the correct events.

Screenshots I added a video on drive with the exact steps that we are doing on all Android versions. https://drive.google.com/file/d/1s7aSoof0ZKJLQXMu87D-fWPyi2Zrmt3D/view?usp=share_link

sshropshire commented 1 year ago

Hi @mionescu95 thanks for using the Braintree SDK for Android. I'm unable to reproduce this issue with our demo application.

I'm not sure what would cause the bottom sheet to not be dismissed in this scenario. Would you be able to set a few breakpoints in our DropInActivity class here and here to inspect the state of the DropInResult result?

mionescu95 commented 1 year ago

Hi @sshropshire I was able to narrow down and seems like it's only reproducible with the checkbox "Don't keep activities" from the developer options. We also had an issue in our code that was restarting the sdk in this situation, that is now removed, so now I can be more specific.

I managed to reproduce it also with your demo app. The behavior is actually not sending anything back to the starting activity and breakpoints you suggested are not hit all the times. If i'm staying a lot in debug and do a step-by-step in debug, they are hit and the app behaves normally. If I stop the debug process, the host app is not receiving anything back. I hope it is a little more helpful now and let me know how can I support.

https://user-images.githubusercontent.com/69837374/232788970-d5500707-f10c-4019-a288-b4dcbcb81445.mov

sshropshire commented 1 year ago

Hi @mionescu95 thanks for this feedback. This is an issue with our 3rd Party MPI provider Cardinal. It's a known issue, i'll reach out to confirm with them and will report back when I hear more information about a potential fix.