#jbring34 - reset M2

1 messages ยท Page 1 of 1 (latest)

fallow knollBOT
full sigil
#

jbring34 - reset M2

#

Good question. Checking in to this and will get back with what I can find.

cosmic cove
#

Thank you

full sigil
cosmic cove
#

Thank you!

honest trout
#

Hello ๐Ÿ‘‹
Can you clarify what kind of "state" are you trying to reset exactly?
Not sure I understand the context here

cosmic cove
#

We had an issue where the reader got stuck in the collectPayment method and when we tried to disconnect we got this error

honest trout
#

What SDK are you using? Looks like iOS but just want to confirm

cosmic cove
#

iOS

#

So what we are trying to do is have a button somewhere where if this happens the user can press a "reset" button or something and the reader just goes back to it's idle state. We haven't been able to recreate this error but just want a solution in case it happens again

honest trout
#

You can't directly disconnect unfortunately

cosmic cove
#

This is our collectPayment method, I believe we are cancelling correctly with it, can you take a look at that file and see if we are handling it correctly?

honest trout
#

I can't seem to download the file for some reason ๐Ÿค” Can you share the snippet instead?

cosmic cove
#

The second screenshot is the end of the function

honest trout
#

Why are you setting self.cancelable as nil in your callback?

cosmic cove
#

Because that is our class level cancelable, we set the collectCancelable to self.cancelable before we set it to nil and then use collectCancelable to call the cancel function

#

So far out of all the times we have tested, we have only hit this issue once, all other times it cancels correctly and the reader goes into its idle state

honest trout
#

Gotcha. Are you also calling the same logic on a button click?
At the moment it looks like its only called if recollectAfterBrandDecline is false

cosmic cove
#

Yes, we have an Exit button where the cancelable.cancel is also called

#

The button action is a function that calls it^

honest trout
#

And you don't have a separate button for disconnect right?

cosmic cove
#

We do, but not on this screen. Once they press the exit button they get taken to a screen where we have a disconnect button

honest trout
#

Gotcha. Honestly, It could've been a race condition of some sort where the disconnect got called before cancellable succeeded.
What you have is exactly what we recommend, call cancellable first then disconnect Reader.
We don't have a "force" disconnect function in the SDK so there's no way to end the current action abruptly and start a new one.

cosmic cove
#

Alright we kinda figured it was some odd case since we only saw it happen 1 time out of all the testing. Thank you for looking it into it!