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

validateAuthenticatedSession performance improvment #403

Closed
idangozlan opened this issue Aug 16, 2023 · 2 comments
Closed

validateAuthenticatedSession performance improvment #403

idangozlan opened this issue Aug 16, 2023 · 2 comments

Comments

@idangozlan
Copy link

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.

Reference:
https://github.com/Shopify/shopify-app-js/blob/main/packages/shopify-app-express/src/middlewares/has-valid-access-token.ts

@byrichardpowell
Copy link
Contributor

Thanks @idangozlan

You are right that this is a performance problem, thanks for opening the issue.

I'm going to close this issue for 2 reasons:

  1. @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.
  2. We have some things on the roadmap that are going to improve the story here. So stay tuned!

@d-simon
Copy link

d-simon commented Nov 6, 2023

2. We have some things on the roadmap that are going to improve the story here.  So stay tuned!

Any ETA on this? :-)

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

3 participants