plugin-throttling.js icon indicating copy to clipboard operation
plugin-throttling.js copied to clipboard

fix(retry-count): don't leak retryCount between requests

Open cvx opened this issue 3 years ago • 1 comments

Fixes #442

Issue:

retryCount was incorrectly shared between all requests AND was never being reset to 0.

Notes:

  1. This adds a retryCount argument to onRateLimit and onSecondaryRateLimit functions. options.request.retryCount is still available as to not break backward compatibility, but since options.request object is shared between all requests, the retry count in there is shared too, so using it is not recommended! I updated the example in readme to use the new argument.
  2. The test for this uses an express server - I wasn't able to replicate the issue with the TestOctokit. Possibly because it handles the request object differently, I'm not sure.

cvx avatar May 24 '22 11:05 cvx

This seems to be huge. If I got it correctly, this means, that current plugin implementation doesn't work in case of concurrent requests. Can we get back to it?

mutantcornholio avatar Oct 28 '22 15:10 mutantcornholio

:tada: This issue has been resolved in version 4.3.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Oct 31 '22 21:10 github-actions[bot]