stripe-ios icon indicating copy to clipboard operation
stripe-ios copied to clipboard

Quickly dismissing 3DS VC crashes the app

Open nickdnk opened this issue 2 years ago • 4 comments

Summary

Immediately dismissing the 3D Secure view controller (presented by handleNextAction()) using the cancel button on the top right crashes the app. You have to be quite quick, but it crashes 100% of the time in that case. I am using test card 4000 0000 0000 3220.

*** Assertion failure in -[STDSACSNetworkingManager submitChallengeRequest:withCompletion:], STDSACSNetworkingManager.m:58
2021-08-10 14:44:48.779690+0200 Nyx[25941:5172779] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'STDSACSNetworkingManager is not intended to handle multiple concurrent tasks.'
*** First throw call stack:
(0x19ff9f298 0x1b3cf9480 0x19feaccc8 0x1a11e4128 0x106902008 0x10692d51c 0x10692fa2c 0x106910774 0x1a2849ca4 0x1a21d9af4 0x1a21d9e34 0x1a21d8784 0x1a28842dc 0x1a2885bc4 0x1a28617f0 0x1a28e4bcc 0x1a28e93f0 0x1a28e06dc 0x19ff1e8f0 0x19ff1e7f0 0x19ff1db44 0x19ff18060 0x19ff17818 0x1b661d570 0x1a28430e8 0x1a2848664 0x104e2fee0 0x19fbf6140)
libc++abi: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'STDSACSNetworkingManager is not intended to handle multiple concurrent tasks.'
terminating with uncaught exception of type NSException

Code to reproduce

STPPaymentHandler.shared().handleNextAction(forPayment: someObject.clientSecret, with: self, returnURL: nil) { status, _, error in

    // we don't make it this far
    
}

iOS version

14.6

Installation method

Pod

SDK version

(21.7.0)

Other information

This could probably be resolved by not enabling the cancel button until the VC is ready to handle dismissal.

nickdnk avatar Aug 10 '21 12:08 nickdnk

Thanks for filing this, that's quite bad! We'll deliver a fix in an upcoming SDK update.

davidme-stripe avatar Aug 12 '21 22:08 davidme-stripe

When are you going to fix this issue? When are you going release SDK version? It's urgent because users with 3DS can't purchase. Thank you in advance.

sargismkhitaryan avatar Oct 26 '21 16:10 sargismkhitaryan

When are you going to fix this issue? When are you going release SDK version? It's urgent because users with 3DS can't purchase. Thank you in advance.

This does not affect users' ability to purchase anything, it only crashes the app if they dismiss the 3DS VC quickly.

nickdnk avatar Oct 26 '21 17:10 nickdnk

This assertion should only be present when compiling a debug build. Unless you've enabled assertions in release builds (using the Enable Foundation Assertions flag in the project settings), a released app should not crash when the VC is dismissed.

We do still plan to fix this in an upcoming version, as the current behavior is broken when assertions are enabled.

davidme-stripe avatar Oct 26 '21 19:10 davidme-stripe

This was resolved in #2096. Closing

sfriedman-stripe avatar Dec 24 '23 06:12 sfriedman-stripe