braintree / braintree-ios-drop-in

Braintree Drop-in for iOS
https://developers.braintreepayments.com
MIT License
98 stars 77 forks source link

Vault Manager Crashing When Removing Payment Method #195

Closed tlynchlaw closed 4 years ago

tlynchlaw commented 5 years ago

General information SDK/Library version: 4.30.0 Environment: Sandbox iOS Version and Device: iOS 13 on iPhone 11 (actual device) Integration type and version: CocoaPods 1.8.4 Issue description Using vaultmanager to edit saved payment methods. When deleting a method, am getting this error:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[2]' *** First throw call stack: (0x18664dc30 0x1863680c8 0x1866a65f4 0x1866b0414 0x1865345f0 0x186525e9c 0x102ab0e14 0x102aafa90 0x102ab0c00 0x1898aaffc 0x1898bb8dc 0x186a1dc60 0x18691f7e8 0x186a1ffbc 0x18691f464 0x186a209e8 0x186a204a8 0x105ad9a48 0x105acb2a8 0x105ace084 0x105acd468 0x105adcaac 0x105add418 0x18635aa60 0x186360c78) libc++abi.dylib: terminating with uncaught exception of type NSException

vaultmanager working fine on the same phone in a different app we built.

demerino commented 5 years ago

I'm unable to recreate the issue. Could you put in a symbolic breakpoint for the NSInvalidArgumentException to track this down to a line number?

tlynchlaw commented 5 years ago

Here's what I got:

libsystem_kernel.dylib`__pthread_kill:

0x1a6edaef4 <+0>:  mov    x16, #0x148

0x1a6edaef8 <+4>:  svc    #0x80

-> 0x1a6edaefc <+8>: b.lo 0x1a6edaf18 ; <+36>

0x1a6edaf00 <+12>: stp    x29, x30, [sp, #-0x10]!

0x1a6edaf04 <+16>: mov    x29, sp

0x1a6edaf08 <+20>: bl     0x1a6eb955c               ; cerror_nocancel

0x1a6edaf0c <+24>: mov    sp, x29

0x1a6edaf10 <+28>: ldp    x29, x30, [sp], #0x10

0x1a6edaf14 <+32>: ret

0x1a6edaf18 <+36>: ret

On Fri, Nov 1, 2019 at 2:22 PM David Merino notifications@github.com wrote:

I'm unable to recreate the issue. Could you put in a symbolic breakpoint for the NSInvalidArgumentException to track this down to a line number?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/braintree/braintree-ios-drop-in/issues/195?email_source=notifications&email_token=ALHB65XJI2K3HAEHES3GRSTQRRXW5A5CNFSM4JH5Z5R2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC3YJDQ#issuecomment-548897934, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALHB65QBOA4GCOEFKOJCZSTQRRXW5ANCNFSM4JH5Z5RQ .

scannillo commented 5 years ago

Hi @tlynchlaw. This still isn't enough information to replicate your issue.

You can also try setting an exception breakpoint to get some more information on the state of the app before it crashes, if potentially the symbolic breakpoint isn't doing what you need.

tlynchlaw commented 5 years ago

Here's what I get the exception breakpoint: line 181 of BTGraphQLHTTP

/// Walks through the input path recursively and adds field errors to a mutable array

Then printing the various objects, I get field is singleUseTokenId, and error JSON[@"message"] is Payment method must belong to current customer and errorJSON[@"extensions"] is

{ errorClass = VALIDATION; errorType = "user_error"; inputPath = ( input, singleUseTokenId ); }

tlynchlaw commented 5 years ago

Since I'm using the sandbox, could it be there are too many fake users with the 4111 Visa card? I am not having the problem with a production version of another app (which, BTW, shares this braintree account).

UPDATE: I just added a JCB card, which no test account has. Then deleted it and it still crashed.

scannillo commented 5 years ago

Are you sure that the customerId you are using to create the clientToken that you are using matches that of the one used to generate the payment method nonce you used to vault the payment?

tlynchlaw commented 5 years ago

We believe the answer is yes. If it wasn’t the same it shouldn’t show the large icons in the drop in.

On Mon, Nov 4, 2019 at 5:41 PM scannillo notifications@github.com wrote:

Are you sure that the customerId you are using to create the clientToken that you are using matches that of the one used to generate the payment method nonce you used to vault the payment?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/braintree/braintree-ios-drop-in/issues/195?email_source=notifications&email_token=ALHB65VLMSWOXNPR2XQEGZDQSCQILA5CNFSM4JH5Z5R2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDA67OI#issuecomment-549580729, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALHB65XCDYEJMJ7Q5MIAKBTQSCQILANCNFSM4JH5Z5RQ .

tlynchlaw commented 5 years ago

We turned on production and it works as expected in production. But sandbox for both iOS and Android fails. iOS crashes and Android shows a message that the payment method can not be updated at this time.

sestevens commented 4 years ago

@tlynchlaw Are you still seeing this problem in sandbox? If not, I'll close this issue.

tlynchlaw commented 4 years ago

It's been awhile. We went to production so I don't know if it still happens.

On Fri, Feb 21, 2020 at 11:42 AM sestevens notifications@github.com wrote:

@tlynchlaw https://github.com/tlynchlaw Are you still seeing this problem in sandbox? If not, I'll close this issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/braintree/braintree-ios-drop-in/issues/195?email_source=notifications&email_token=ALHB65VBNML5EJH2BYEB62DREAAAHA5CNFSM4JH5Z5R2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMTKETI#issuecomment-589734477, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALHB65QZDEDF5SRNUZBGYULREAAAHANCNFSM4JH5Z5RQ .

sestevens commented 4 years ago

I'm going to close this issue then, but please let us know if you run into the problem again.