Stripe-android: Config change cause result never being delivered to the fragment

Created on 10 Jun 2020  路  3Comments  路  Source: stripe/stripe-android

Summary


related #2482
related #1937
I've actually commented once about this already in https://github.com/stripe/stripe-android/issues/1937#issuecomment-566135730 - the issue indeed seems to be fixed for activities but its still occurring in case of using the stripe in fragment and is reproducible in the sample - FragmentExampleFragments

Steps to reproduce

  1. Open Fragment Examples
  2. Start authentication
  3. When auth screen shows open split screen
  4. Confirm
  5. Result never delivered

Other information

triaged

Most helpful comment

Hello,

I've noticed this ticket and would like to make an update with regards to 3DS2. For 3DS1 I was able to reproduce the issue using Don't Keep Activities however there's a different behaviour for 3DS2 (Card: 4000000000003220).
In Stripe version 14.5.0 the Auth Screen gets stuck in the loading state endlessly
In Stripe version 15.0.2 the Auth Screen opens and then closes without any confirmation from the user after a few seconds

I have attached a screenshot of the screen in question
Screenshot_1596805284

Thank you

All 3 comments

@freszu what version of the SDK are you using? Also what OS version/device are you testing on?

@mshafrir-stripe Sorry for late response

Device: Pixel 4
Android: 10
Sdk: current master a08c4148a4189ac182eea58c4c477d4e9169a959 + same is reproducible in the app using 14.5.0

All the issues are reproducible in examples provided in stripe repository. Every single of them is reproducible with any config change (e.g. screen rotation, going split screen, language change).

I use here split screen mode as it's easiest to follow but i can imagine someone doing that in real life or just rotating the device for whatever reason. The bug might also be reproduced in other config change related scenarios - didn't check what happens if the app proces would die for example and if that would be properly handled(may be worth checking) - imagine receiving auth flow and going to another screen to check anything while the app is killed which is a real case that might happen on lower end devices.

Repro (there is additional toast inserted for every activity result):


Normal flow(for reference)

success



No result in fragment (biggest issue as this is easiest to reproduce)

(black screen is when the 3ds flow becomes visible)
no-result



Crash - when timed properly

crash

FATAL EXCEPTION: DefaultDispatcher-worker-3
    Process: com.stripe.example, PID: 19818
    java.lang.IllegalStateException: Fragment FragmentExamplesFragment{380015a (5e529fd0-ce46-4dbb-b91b-7a526bd79c5a)} not attached to an activity.
        at androidx.fragment.app.Fragment.requireActivity(Fragment.java:802)
        at com.stripe.android.stripe3ds2.transaction.Stripe3ds2ActivityStarterHost.<init>(Unknown Source:5)
        at com.stripe.android.StripePaymentController$Stripe3ds2AuthCallback.startChallengeFlow(StripePaymentController.kt:793)
        at com.stripe.android.StripePaymentController$Stripe3ds2AuthCallback.onSuccess(StripePaymentController.kt:722)
        at com.stripe.android.StripePaymentController$Stripe3ds2AuthCallback.onSuccess(StripePaymentController.kt:698)
        at com.stripe.android.ApiOperation.dispatchResult(ApiOperation.kt:52)
        at com.stripe.android.ApiOperation.access$dispatchResult(ApiOperation.kt:16)
        at com.stripe.android.ApiOperation$execute$1$1.invokeSuspend(ApiOperation.kt:43)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

Hello,

I've noticed this ticket and would like to make an update with regards to 3DS2. For 3DS1 I was able to reproduce the issue using Don't Keep Activities however there's a different behaviour for 3DS2 (Card: 4000000000003220).
In Stripe version 14.5.0 the Auth Screen gets stuck in the loading state endlessly
In Stripe version 15.0.2 the Auth Screen opens and then closes without any confirmation from the user after a few seconds

I have attached a screenshot of the screen in question
Screenshot_1596805284

Thank you

Was this page helpful?
0 / 5 - 0 ratings