#manuel_terminal-connectiontoken

1 messages ¡ Page 1 of 1 (latest)

lean quarryBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1433488714935566398

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

vague flare
#

Hi there

lone sentinel
#

Regarding getting the token from backend, If we have some latency, how we can manage correctly the TokenProvider fetching method?

vague flare
#

I'm not sure what you mean by that exactly? You mean if the latency to fetch causes the token to expire?

lone sentinel
#

Here I request the token from backend. What happen if the response from this method have latency? I have to call again Terminal.getInstance().discoverReaders ?

lean quarryBOT
vague flare
#

What does "have latency" mean. If you hit an error then yes you would discover readers again or create a new connection token.

#

But I'm not sure if that is what you are asking?

lone sentinel
#

time for the response of the token request (30, 40, 70 seconds)

#

how manage the SDK the callback for fetchConnectionToken

deep hornet
#

ok, so you're wondering how to handle cases where the actual request to get the token encounters extreme latency?

#

have you encountered extreme latency like that, or are you just futureproofing?

#

actually i think i understand your question, let me dig for a bit

#

in general the SDK should manage connection tokens for you, and if for some reason there is extreme latency or a token expires, then the operation you are running should fail

#

so retrying discovery on the application side would make sense

lone sentinel
#

here we have an exception about that

deep hornet
#

does that answer your question or do you still need more support?

lone sentinel
#

The connectionTokenProviderError related to timeouts is thrown during the discoverReaders and connectReader methods. In this case, we have to retry the flow multiple times.

From what I understand, the Stripe SDK requires the backend token to be provided within a specific time window (around 60 seconds). If the backend latency persists beyond that, we would basically remain in a waiting loop (possibly with continuous retries) until the backend normalizes, correct?

deep hornet
#

yeah, that sounds about right. is there a reason your backend is taking that long to return the token? the stripe API itself should return pretty quickly

lean quarryBOT