Skip to content

Shopify 503 errors in validateAuthenticatedSession crash server #1860

Open
@User7840

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

lizkenyon commented on Dec 11, 2024

@lizkenyon
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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

      Participants

      @lizkenyon@User7840

      Issue actions

        Shopify 503 errors in validateAuthenticatedSession crash server · Issue #1860 · Shopify/shopify-app-js