Shopify / Shopify/shopify-api-php

All requests should have the option to pass $tries

Open
#203 24 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.