iZettle / sdk-ios

Add card payments from Zettle to your own app
https://developer.zettle.com/docs/ios-sdk
Other
82 stars 38 forks source link

3.7.1/3.7.0 Crash on charge after pairing terminal for the first time when tipping is enabled #422

Closed ls-alexandre-perez closed 1 year ago

ls-alexandre-perez commented 1 year ago

Expected Behavior

No crash :)

Current Behavior

Uncaught exception that result to a crash

Steps to Reproduce

Context

Failure Logs

Logs

*** Terminating app due to uncaught exception 'assert((currencyExponent)) failed!!', reason: '-[DatecsReader captureGratuityWithAmount:type:currencyExponent:] in DatecsReader.m(954): assert((currencyExponent)) failed!! -- Invalid parameter not satisfying: currencyExponent'
*** First throw call stack:
(0x182875c80 0x19a09bee4 0x1828c8e84 0x113d73548 0x113d7905c 0x113d600fc 0x113d5fe84 0x113d5fb84 0x113d5faec 0x113d5f8c4 0x113d5f6a4 0x113d41464 0x113d40e68 0x113d40da0 0x113d40060 0x113d40a60 0x113d41410 0x113d5f088 0x113d5bb94 0x113d41464 0x113d40e68 0x113d40da0 0x113d40704 0x113d41164 0x113d40704 0x113d41164 0x113d40060 0x113d40f60 0x113d40da0 0x113d40704 0x113d43468 0x113d40704 0x113d41164 0x113d40704 0x113d41afc 0x113d40704 0x113d31eb8 0x113d5ea44 0x113d8ffb4 0x113d7876c 0x113d7b690 0x113d47bc8 0x113d7ff60 0x113d7fd78 0x113d3221c 0x113d41464 0x113d40e68 0x113d40da0 0x113d40704 0x113d41164 0x113d40060 0x113d40f60 0x113d40da0 0x113d40704 0x113d41164 0x113d40060 0x113d40f60 0x10fea8700 0x10fea9fc8 0x10feb88ac 0x10feb84fc 0x182831034 0x1827ee538 0x182801194 0x1a3150988 0x185004a88 0x184d9dfc8 0x102b20ee0 0x10f83c4d0)
libc++abi: terminating with uncaught exception of type NSException
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
*** Terminating app due to uncaught exception 'assert((currencyExponent)) failed!!', reason: '-[DatecsReader captureGratuityWithAmount:type:currencyExponent:] in DatecsReader.m(954): assert((currencyExponent)) failed!! -- Invalid parameter not satisfying: currencyExponent'
terminating with uncaught exception of type NSException

Trace

Thread 1 Queue : com.apple.main-thread (serial)
#0  0x00000001bc42fbbc in __pthread_kill ()
#1  0x00000001dcbc4854 in pthread_kill ()
#2  0x000000018cf626ac in abort ()
#3  0x000000019a193dd8 in abort_message ()
#4  0x000000019a18455c in demangling_terminate_handler() ()
#5  0x000000019a0a18f8 in _objc_terminate() ()
#6  0x0000000110d0762c in (anonymous namespace)::TerminateHandler::kotlinHandler()::'lambda'()::operator()() const ()
#7  0x0000000110d07584 in void (anonymous namespace)::$_0::operator()<(anonymous namespace)::TerminateHandler::kotlinHandler()::'lambda'()>((anonymous namespace)::TerminateHandler::kotlinHandler()::'lambda'()) ()
#8  0x0000000110d0755c in (anonymous namespace)::TerminateHandler::kotlinHandler() ()
#9  0x000000019a193274 in std::__terminate(void (*)()) ()
#10 0x000000019a19321c in std::terminate() ()
#11 0x000000019a0af46c in objc_terminate ()
#12 0x000000010fea9fdc in _dispatch_client_callout ()
#13 0x000000010feb88ac in _dispatch_main_queue_drain ()
#14 0x000000010feb84fc in _dispatch_main_queue_callback_4CF ()
#15 0x0000000182831034 in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ ()
#16 0x00000001827ee538 in __CFRunLoopRun ()
#17 0x0000000182801194 in CFRunLoopRunSpecific ()
#18 0x00000001a3150988 in GSEventRunModal ()
#19 0x0000000185004a88 in -[UIApplication _run] ()
#20 0x0000000184d9dfc8 in UIApplicationMain ()
#21 0x0000000102b20ee0 in main at main.m:15
#22 0x000000010f83c4d0 in start ()
Thread#0    0x0000000182875c80 in __exceptionPreprocess ()
#1  0x000000019a09bee4 in objc_exception_throw ()
#2  0x00000001828c8e84 in +[NSException raise:format:] ()
#3  0x0000000113d73548 in izAssert ()
#4  0x0000000113d7905c in -[DatecsReader captureGratuityWithAmount:type:currencyExponent:] ()
#5  0x0000000113d600fc in -[IZCardPaymentManager captureGratuityOnReader:amount:tippingType:tippingTypeString:currencyExponent:] ()
#6  0x0000000113d5fe84 in -[IZCardPaymentManager startCaptureGratuityFlowOn:tippingType:] ()
#7  0x0000000113d5fb84 in -[IZCardPaymentManager doTippingFlow:tippingType:] ()
#8  0x0000000113d5faec in -[IZCardPaymentManager maybeTip:] ()
#9  0x0000000113d5f8c4 in -[IZCardPaymentManager maybeTipThenCharge:] ()
#10 0x0000000113d5f6a4 in -[IZCardPaymentManager chargeReader:] ()
#11 0x0000000113d41464 in __28-[IZFuture(Operations) then]_block_invoke_2 ()
#12 0x0000000113d40e68 in __37-[IZFuture(Operations) thenComplete:]_block_invoke_2 ()
#13 0x0000000113d40da0 in __37-[IZFuture(Operations) thenComplete:]_block_invoke.86 ()
#14 0x0000000113d40060 in -[IZTask setCompletion:] ()
#15 0x0000000113d40a60 in -[IZFuture(Operations) thenComplete:] ()
#16 0x0000000113d41410 in __28-[IZFuture(Operations) then]_block_invoke ()
#17 0x0000000113d5f088 in -[IZCardPaymentManager checkBackgroundUpdateThenCharge:] ()
#18 0x0000000113d5bb94 in __29-[IZCardPaymentManager start]_block_invoke.34 ()
#19 0x0000000113d41464 in __28-[IZFuture(Operations) then]_block_invoke_2 ()
#20 0x0000000113d40e68 in __37-[IZFuture(Operations) thenComplete:]_block_invoke_2 ()
#21 0x0000000113d40da0 in __37-[IZFuture(Operations) thenComplete:]_block_invoke.86 ()
#22 0x0000000113d40704 in -[IZTask complete:orAbort:onScheduler:] ()
#23 0x0000000113d41164 in __37-[IZFuture(Operations) thenComplete:]_block_invoke.87 ()
#24 0x0000000113d40704 in -[IZTask complete:orAbort:onScheduler:] ()
#25 0x0000000113d41164 in __37-[IZFuture(Operations) thenComplete:]_block_invoke.87 ()
#26 0x0000000113d40060 in -[IZTask setCompletion:] ()
#27 0x0000000113d40f60 in __37-[IZFuture(Operations) thenComplete:]_block_invoke_2 ()
#28 0x0000000113d40da0 in __37-[IZFuture(Operations) thenComplete:]_block_invoke.86 ()
#29 0x0000000113d40704 in -[IZTask complete:orAbort:onScheduler:] ()
#30 0x0000000113d43468 in __28+[IZFuture(Operations) any:]_block_invoke_4 ()
#31 0x0000000113d40704 in -[IZTask complete:orAbort:onScheduler:] ()
#32 0x0000000113d41164 in __37-[IZFuture(Operations) thenComplete:]_block_invoke.87 ()
#33 0x0000000113d40704 in -[IZTask complete:orAbort:onScheduler:] ()
#34 0x0000000113d41afc in __31-[IZFuture(Operations) always:]_block_invoke_3 ()
#35 0x0000000113d40704 in -[IZTask complete:orAbort:onScheduler:] ()
#36 0x0000000113d31eb8 in -[IZTask(Utilities) complete:orAbort:onQueue:] ()
#37 0x0000000113d5ea44 in __58-[IZCardPaymentManager handleConfigurationStatusOfReader:]_block_invoke ()
#38 0x0000000113d8ffb4 in -[IZCallbacker callAllWithValue:] ()
#39 0x0000000113d7876c in -[DatecsReader setConfigurationState:] ()
#40 0x0000000113d7b690 in __43-[DatecsReader updateConfigurationIfNeeded]_block_invoke_2 ()
#41 0x0000000113d47bc8 in __109-[IZDatecsReaderConfigurator configureReader:usingNetworkContext:userIdentifier:softwareVersions:completion:]_block_invoke_2 ()
#42 0x0000000113d7ff60 in -[IZEmvConversation handleBackendResponse:] ()
#43 0x0000000113d7fd78 in __46-[IZEmvConversation sendAppRequest:isInitial:]_block_invoke ()
#44 0x0000000113d3221c in __31-[IZFuture(Utilities) onResult]_block_invoke_2 ()
#45 0x0000000113d41464 in __28-[IZFuture(Operations) then]_block_invoke_2 ()
#46 0x0000000113d40e68 in __37-[IZFuture(Operations) thenComplete:]_block_invoke_2 ()
#47 0x0000000113d40da0 in __37-[IZFuture(Operations) thenComplete:]_block_invoke.86 ()
#48 0x0000000113d40704 in -[IZTask complete:orAbort:onScheduler:] ()
#49 0x0000000113d41164 in __37-[IZFuture(Operations) thenComplete:]_block_invoke.87 ()
#50 0x0000000113d40060 in -[IZTask setCompletion:] ()
#51 0x0000000113d40f60 in __37-[IZFuture(Operations) thenComplete:]_block_invoke_2 ()
#52 0x0000000113d40da0 in __37-[IZFuture(Operations) thenComplete:]_block_invoke.86 ()
#53 0x0000000113d40704 in -[IZTask complete:orAbort:onScheduler:] ()
#54 0x0000000113d41164 in __37-[IZFuture(Operations) thenComplete:]_block_invoke.87 ()
#55 0x0000000113d40060 in -[IZTask setCompletion:] ()
#56 0x0000000113d40f60 in __37-[IZFuture(Operations) thenComplete:]_block_invoke_2 ()
#57 0x000000010fea8700 in _dispatch_call_block_and_release ()
#58 0x000000010fea9fc8 in _dispatch_client_callout ()
#59 0x000000010feb88ac in _dispatch_main_queue_drain ()
#60 0x000000010feb84fc in _dispatch_main_queue_callback_4CF ()
#61 0x0000000182831034 in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ ()
#62 0x00000001827ee538 in __CFRunLoopRun ()
#63 0x0000000182801194 in CFRunLoopRunSpecific ()
#64 0x00000001a3150988 in GSEventRunModal ()
#65 0x0000000185004a88 in -[UIApplication _run] ()
#66 0x0000000184d9dfc8 in UIApplicationMain ()
#67 0x0000000102b20ee0 in main at main.m:15
#68 0x000000010f83c4d0 in start ()
ppeelen commented 1 year ago

Hi @ls-alexandre-perez!

Thank you for reporting this issue and for your thorough description of it. We will look into this and get back to you if we have any further questions.

ppeelen commented 1 year ago

Hi again @ls-alexandre-perez! We have tried to investigate this for now and it seems that the reason for your issue is account related, hence we need more specific account information. Could you please request support via https://developer.zettle.com so we can help you further?

planetcoops commented 1 year ago

@ppeelen I just wanted to add that we also have this identical crash so this is not isolated to just @ls-alexandre-perez 's account.

ppeelen commented 1 year ago

@planetcoops very good to know. I would like to request you to do the same thing, as we need more detailed account information to investigate the problem and find the root cause.

planetcoops commented 1 year ago

@planetcoops very good to know. I would like to request you to do the same thing, as we need more detailed account information to investigate the problem and find the root cause.

Logged as ticket: https://ext-izettle.atlassian.net/servicedesk/customer/portal/3/API-1739

ls-alexandre-perez commented 1 year ago

Hi again @ls-alexandre-perez! We have tried to investigate this for now and it seems that the reason for your issue is account related, hence we need more specific account information. Could you please request support via https://developer.zettle.com so we can help you further?

Ticket number: API-1741

planetcoops commented 1 year ago

3.7.2 resolves the issue for me. How about you, @ls-alexandre-perez ?

ppeelen commented 1 year ago

3.7.2 resolves the issue for me. How about you, @ls-alexandre-perez ?

Great! I was just about to inform you about that. We identified a second which seemed to have triggered for your setups. We adressed this in 3.7.2 which I believe our support reached out to you about.

I will close this issue for now. If you are still experiencing this issue, please let us know and we will reopen the issue and assist you further.

Thank you for pointing this out to us!

ls-alexandre-perez commented 1 year ago

Yes, 3.7.2 fixes the issue. Thanks!