You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of today, the shopify-app-express lib middleware validateAuthenticatedSession calls hasValidAccessToken, which makes a super slow GQL test request that sometimes can take up to a second. Since this middleware should be used on every API call, I suggest either creating a designated test query that can run much faster or finding another solution to verify that the client is ready / let the developer decide whether to verify across this test query.
The current state requires us to fork this middleware and create a custom one without this GQL test query, to improve the user experience.
I spotted around 1s duration for this gql call to run from GCP servers, which is obviously unacceptable.
You are right that this is a performance problem, thanks for opening the issue.
I'm going to close this issue for 2 reasons:
@shopify/shopify-app-express if a fairly un-opinionated package, so it's quite difficult to solve this in a universal way that doesn't cost the developer flexibility. This issue doesn't exist in @shopify/shopify-app-remix because this package is fairly opinionated. Could you switch to Remix? I completely understand this might not be viable.
We have some things on the roadmap that are going to improve the story here. So stay tuned!
As of today, the
shopify-app-express
lib middlewarevalidateAuthenticatedSession
callshasValidAccessToken
, which makes a super slow GQL test request that sometimes can take up to a second. Since this middleware should be used on every API call, I suggest either creating a designated test query that can run much faster or finding another solution to verify that the client is ready / let the developer decide whether to verify across this test query.The current state requires us to fork this middleware and create a custom one without this GQL test query, to improve the user experience.
I spotted around 1s duration for this gql call to run from GCP servers, which is obviously unacceptable.
Reference:
https://github.com/Shopify/shopify-app-js/blob/main/packages/shopify-app-express/src/middlewares/has-valid-access-token.ts
The text was updated successfully, but these errors were encountered: