stripe / stripe-terminal-react-native

React Native SDK for Stripe Terminal
https://stripe.com/docs/terminal/payments/setup-integration?terminal-sdk-platform=react-native
MIT License
106 stars 50 forks source link

Endless NETWORK_ERROR.CONNECTION_TOKEN_PROVIDER_ERROR on connectBluetoothReader after bundle reload in Expo #644

Closed Noitidart closed 5 months ago

Noitidart commented 6 months ago

Describe the bug When I push a remote update via EAS (Expo), beofore calling Expo's Updates.reloadAsnc which reloads the app bundle, I call disconnectReader. Then on startup of, I call initialize, discoverReaders, and then connectBluetoothReader. The connectBluetoothReader endlessly resolves with this error response:

{
  error: {
    code: NETWORK_ERROR.CONNECTION_TOKEN_PROVIDER_ERROR,
    message: Timed out waiting for connection token
  }
}

If I hard close the app, and re-launch it, it does the same three calls and succeeds very fast. So internet connectivity is not a problem. This happens on two my touchscreens. One is hard wired ethernet, the other is wifi.

To Reproduce Steps to reproduce the behavior: It doesn't happen all the time, but eventually an app bundle reload as I described above does this.

  1. Please see the above description.

Expected behavior When interent is good, it should not resolve with error of NETWORK_ERROR.CONNECTION_TOKEN_PROVIDER_ERROR.

Screenshots If applicable, add screenshots to help explain your problem.

Stripe Terminal React Native SDK version

Smartphone (please complete the following information):

Additional context

Is there maybe other steps other than disconnectReader I should call before reloading the app bundle?

Noitidart commented 5 months ago

I think I solved this, I think it was my retry strategy over retrying.

sammy-black commented 1 month ago

I think I solved this, I think it was my retry strategy over retrying.

I am experiencing similar issue now but i am unable to fix it. what do you mean by "retry strategy over retrying" WhatsApp Image 2024-08-21 at 16 05 33_ac0409d7