#melarts

1 messages · Page 1 of 1 (latest)

radiant vigilBOT
gleaming dust
warm scaffold
#

we are using AWS lambda as our back-end to call stripe API

#

and it is working fine!

gleaming dust
warm scaffold
#

Yes but this happens when de connection is lost.. I would like to understand the first error before, like in which situation de connection token expiration error is thrown?

gleaming dust
#

Connection Tokens expire, it's expected. Usually the Terminal SDK will fetch a new one using the fetch handler you provide, so your backend can generate a new one before the old one expires.

#

You're supplying the fetch handler, and it looks like it's generating a new one, so that part should be good.

warm scaffold
#

so it is normal that this erreur happen and right after fetchConnectionToken is supposed to be called, right ?

gleaming dust
#

I think usually the SDK will fetch before the connection token expires, but I think there are some scenarios where the error happens first.

warm scaffold
#

ok.. I don't have any hint on how to fix issue then 😦 i don't understand

gleaming dust
#

I don't think it's an issue on your end, I think the network issue is actually the problem.

#

I don't think the connection token has anything to do with the actual issue. The main problem seems to be the DNS issue.

warm scaffold
#

yes but the DNS is correct since the reader was previously successfully connected

gleaming dust
#

The console errors you shared indicate something changed though, and it's no longer able to resolve that hostname and connect to the reader.

warm scaffold
#

this error happen when you lose the internet connection

#

i mean i can have this error if i turn off the wifi

gleaming dust
#

That's one possible cause, sure, but there are many others.

#

The DNS server could be down, for example.

#

Or the network connection could be degraded.

#

How do they fix this issue when it happens?

warm scaffold
#

We tell them to reload their page. Some reboot fully their computer

#

but because of this our solution in not fully trusted

gleaming dust
warm scaffold
#

yup ! you can see it in my second screenshot

gleaming dust
#

I only see a dispatch there, not what that code actually does.

warm scaffold
#

basically user see a toast informing that the reader is disconnected and we reset all of store related to the reader so it is like no reader is connected visually. in order to match what is happening with the terminal

gleaming dust
#

Does that happen when this problem occurs?

#

And do you then call discoverReaders or show the UI to reconnect?

warm scaffold
#

I guess but I'm not sure since we don't manage to fully reproduce the error on our side :/ That's why I'm trying to understand the process

#

But when the reader is disconnected they can try with a UI to reconnect it. And this is where they tell us that it is impossible to reconnect it

gleaming dust
#

Can you add more logging to your code to determine exactly what happens when this issue occurs? Does the disconnect handler get called? Does it discoverReaders? Does it hit an error?

radiant vigilBOT
warm scaffold
#

I mean i could but as I was saying this is not an error we manage to reproduce on dev side so it won't be instant. Are we the only persons using stripe terminal to face such issues ?

rancid holly
#

Hi there. Rubeus had to step away. Give me a bit to catch up on the issue here

#

Yeah really we need more info here, so recommend implementing what Rubeus suggested here:
Can you add more logging to your code to determine exactly what happens when this issue occurs? Does the disconnect handler get called? Does it discoverReaders? Does it hit an error?
Network issues are common, but they manifest in many different ways. We'd need some more insight into the above first.

warm scaffold
#

Alright. I'll try to come again with hopefully more informations , thanks