While writing some tests for our own usage of shopif-api-node, I noticed that retries on retryableStatusCodes were not respecting got's retry limit. According to got's documentation:
This function is responsible for the entire retry mechanism, including the limit property. To support this, you need to check if computedValue is different than 0.
Let's rely on their recommended check to ensure we aren't past the retry limit and ensure that retries are not indefinite if a maxRetries is set. Lastly, since we haven't explicitly included status code 200 as retryable we have to handle "Throttled" requests before attempting to check computedValue.
Coverage remained the same at 100.0% when pulling f3e627c3e4829cb6f3090505e7bd174f55c58cbd on gadget-inc:respect-max-retries into e9952867bbb1945d9d8932c0b4833478c47efe04 on MONEI:master.
While writing some tests for our own usage of
shopif-api-node
, I noticed that retries onretryableStatusCodes
were not respectinggot
's retry limit. According togot
's documentation:Let's rely on their recommended check to ensure we aren't past the retry limit and ensure that retries are not indefinite if a
maxRetries
is set. Lastly, since we haven't explicitly included status code200
as retryable we have to handle "Throttled" requests before attempting to checkcomputedValue
.