Shopify / Shopify/shopify-api-php
All requests should have the option to pass $tries
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 473
- Forks
- 193
- Avg merge
- 5h 8m
- Merged PRs (30d)
- 1
Description
Overview/summary
Currently the abstract API calls will not handle rate limiting because $tries is not passed on here:
https://github.com/Shopify/shopify-api-php/blob/582252eaedb2bb6828bb2d02238e14010d79a2e3/src/Rest/Base.php#L173-L186
Thus $maxTries will default to 1:
https://github.com/Shopify/shopify-api-php/blob/582252eaedb2bb6828bb2d02238e14010d79a2e3/src/Clients/Http.php#L150
Motivation
We ran into rate limiting issues that weren't handled by the library.
Possible solution
In Base.php it should take apart the $params array and take out a tries value from there, to pass it on to the appropriate function. Another solution would be to simply add an optional parameter up the chain, but that would involve changing every function in this library.
Checklist
- I have described this enhancement in a way that is actionable (if possible)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/Rest/Base.php at the linked request methods, then trace how src/Clients/Http.php handles $maxTries when no value is passed. Determine how the abstract API calls should forward a tries value from $params, and verify that rate-limited requests can use it without changing unrelated call behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100