Open
Description
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()
Activity
lizkenyon commentedon Dec 11, 2024
Thanks for flagging this! I will add this to our backlog.