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

Shopify 503 errors in validateAuthenticatedSession crash server #1860

Open
User7840 opened this issue Dec 11, 2024 · 1 comment
Open

Shopify 503 errors in validateAuthenticatedSession crash server #1860

User7840 opened this issue Dec 11, 2024 · 1 comment

Comments

@User7840
Copy link

The middleware function hasValidAccessToken runs a graphql query to check authentication. If this query fails due to a 503 error, which will occasionally occur at random from Shopify api, the function throws an error which isn't handled by the caller (validateAuthenticatedSession).
This causes my whole server to go down randomly because I can't catch the errors anywhere due to them being async.

Also see #427

Expected behavior

50x errors should cause the middleware to fail normally rather than going uncaught

hasValidAccessToken() should be wrapped in a try/catch block inside validateAuthenticatedSession and have errors handled by handleSessionError()

@lizkenyon
Copy link
Contributor

Thanks for flagging this! I will add this to our backlog.

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

No branches or pull requests

2 participants