-
Notifications
You must be signed in to change notification settings - Fork 201
Fix shopify extension
commands timeout when organization has too many apps
#1850
Conversation
lib/project_types/extension/forms/questions/ask_registration.rb
Outdated
Show resolved
Hide resolved
…LI::PartnersAPI::Organizations.fetch_with_extensions`
Thank you for the review and the suggestions, @catlee! 🚀 I've gone through all comments, and I believe we now have a more robust mechanism. Please, let me know what do you think :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better, thanks for fixing this up!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome @karreiro and that pattern that you introduced will be useful in other places. I'll be OOO from tomorrow (Friday) so I won't be able to see the answers to my comments. Don't let them block you, if you disagree with some you can go ahead and merge and we can talk about them in January. Again, amazing!
Thanks a lot for the review, @pepicrft! I've applied the fixes for most comments in a new commit. Also, don't hesitate to ping me in January if I've missed something 😊 |
WHY are these changes introduced?
When users run
shopify extension
commands, and the organization has too many apps (~ 100), they're facing timeout issues:WHAT is this pull request doing?
Eager loading
extensionRegistrations
withall_orgs_with_extensions.graphql
takes too long for organizations with a large number of apps.I've initially considered paginating this query to avoid timeouts, but users would still need to wait too long.
So, this PR changes the
ShopifyCLI::PartnersAPI::Organizations.fetch_with_extensions
method to fetchextensionRegistrations
individually and in parallel.For a small number of apps, this change has almost no impact. But, for many apps (> 40), it gets expressive faster results:
Also, this PR introduces a spinner in the
"Loading your extensions…"
message.How to test your changes?
Run
shopify extension connect
and notice the timeout won't happen anymore*:Post-release steps
None.
Update checklist