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

UserCanceledException if the app is killed by the system while in background #463

Open
matteo-goghero-leitha opened this issue Mar 5, 2024 · 2 comments

Comments

@matteo-goghero-leitha
Copy link

Braintree SDK Version

6.13.0

Environment

Sandbox

Android Version & Device

Google Pixel 4a - Android 14 (but issue present in every android version)

Braintree dependencies

implementation("com.braintreepayments.api:drop-in:6.13.0")

Describe the bug

After launching DropIn payment flow, and while the DropIn activity is shown, if the app is put in the background (let's say to open the banking app to get a confirmation code) and it is killed by the system (low-memory kill or background process policy set to "No background processes") when the user returns to the app the DropIn API will throw UserCanceledException preventing the user to complete the payment process.

To reproduce

  1. Launch DropIn
  2. Select payment method
  3. Wait for the card information screen or bank code verification screen
  4. Put the app in the background by pressing the home button
  5. Kill the app process via adb or via android studio logcat button "Kill process" (to simulate the system killing the app)
  6. Return to the app by clicking on the app icon or from the recent apps screen
  7. Complete the payment process if possible (only if the app was killed in the bank code verification step, otherwise the dropIn closes automatically)
  8. Check for dropIn result, it should be UserCanceledException

Expected behavior

The DropIn process should retain and restore its state via SavedStateInstance (or equivalent method) and allow the user to complete the payment process even if the app is killed while in the background without returning UserCanceledException.

Screenshots

Step 2 - start drop in:
image

Step 3 - go to code confirmation screen:
image

Step 4 - put app in the background by pressing home button

Step 5 - kill the app as if the system did it:
image

Step 6 - Return to the app

Step 7 - Complete payment process if possible

Step 8 - check that UserCanceledException is returned:
image

@matteo-goghero-leitha
Copy link
Author

Hi, any updates on this? Thank you

@sshropshire
Copy link
Contributor

Hi @matteo-goghero-leitha thanks for filing this bug. Unfortunately for the 3DS library we use at the moment doesn't support process kill fully. It's something we've brought up and we hope it gets prioritized in the near future.

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