shopifypartners / developer-tools

Shopify Developer Tools is a macOS app that connects to your Shopify store(s) and allows you to make authenticated calls to the Admin API, generate dummy data, and view and customize Polaris components.
263 stars 27 forks source link

Developer Tools doesn't handle rate limiting / retry requests #15

Open amwolff opened 6 years ago

amwolff commented 6 years ago

Data generator always leaves some requests failed. I assume this is due to unhandled rate limiting. Requests should be allowed to be retried.

aekinkjet commented 5 years ago

good

amwolff commented 5 years ago

No, this is bad actually.

TotalJabroni commented 5 years ago

Any update here? More and more often my order import completely fails.

Screen Shot 2019-05-13 at 3 40 45 PM
csciuto commented 5 years ago

My problem here is that when you are creating orders for existing customers, it has to download the customer list fresh every time.

With a couple hundred pages of customers, since the tool does not self-throttle, you'll always fail to do the meaningful work that comes after the download.

I tried figuring out if it's possible to create a throttling profile in Chrome Dev Tools that slows this down enough to not cause issues, but even at a custom setting that is half of 2G, most requests still fail.

csciuto commented 5 years ago

There's more to this it looks, I think my original guess as to what's going on was wrong. The rate limit header is reporting 0/320 requests when I get the 429, and retry-after is coming back empty. This is the same orders.json endpoint that @TotalJabroni is using, and I'm getting the same "exceeded 0 calls per second" message.

It seems to me like what's actually happening here is this endpoint only allows four requests at once, but Chrome supports a few more than that. End result is that the tool is kicking off request after request that fail very quickly while the four in-process ones take a second or so to complete.

felipap commented 5 years ago

@csciuto Care to share how you worked around this? :P

csciuto commented 5 years ago

@felipap I really didn't work around it. Given enough time, you can create data four items every X minutes, with massive amounts of failures in between, which is not ideal for us the clients, and I'm sure the servers don't appreciate it, either.

felipap commented 5 years ago

@csciuto Would one be able to create a Shopify app that does this the right way ie. creates custom users/orders/products for developer testing? Do you see a real need for this?

csciuto commented 5 years ago

@felipap I consider it a nice-to-have. My QE org I believe already has tools that do this programmatically, but as a dev and just fooling around, it wasn't great that it was so hard to create data using the provided tool.