Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to fetch ConnectionToken on app init does not throw or surface error #26

Closed
jdivock-stripe opened this issue Jan 26, 2022 · 3 comments · Fixed by #86
Closed
Assignees
Labels

Comments

@jdivock-stripe
Copy link
Contributor

jdivock-stripe commented Jan 26, 2022

Steps to repro:

  • turn off backend
  • initialize app

I think we need error handling logic in

const tokenProviderHandler = useCallback(async () => {
const connectionToken = await tokenProvider();
setConnectionToken(connectionToken);
}, [tokenProvider]);

Currently the app will continue to init and calls to discoverReaders() will execute but not update discoveredReaders, more concerning the error payload from discoverReaders does not populate when there's no connectionToken in use.

Also it looks like there's logic in the iOS app about using the correct key that's surpassed so looks like we want to make sure we're surfacing that as well (thanks @jil-stripe #76)

@jdivock-stripe
Copy link
Contributor Author

Also of note that the invalid connection token appears to be cached, we should reset it internally when it fails so a new one can be fetched

@jdivock-stripe jdivock-stripe added p0 and removed p1 labels Feb 7, 2022
@jdivock-stripe
Copy link
Contributor Author

going to raise the priority on this one as it's a pretty frustrating failure mode. The SDK will continue to try to perform actions and often just silently fail if it cannot reach the backend or has an invalid connection token.

@jdivock-stripe
Copy link
Contributor Author

I worry fundamentally about having fetchConnectionToken fire on app mount a this seems fairly unexpected and I'm unsure how we'd properly wire in error surfacing around this. Can we refactor the SDK to be explicitly initialized by the user so they can delay configuring it without having to guard against mounting anything nested in <StripeTerminal/>

cc @dhenry-stripe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants