You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
_retryCount is shared between multiple requests making it dangerous to infinite requests #170
Describe the bug
Because _retryCount is not local var to _attemptRequest, it's possible to create infinite loops since a new request restarts the _retryCount to 0 for all pending requests.
To Reproduce
Add a shouldAttemptRetryOnResponse that starts a new request with the same intercepted client that succeeds ( e.g. a refresh )
Make an api request that fails all the time and calls shouldAttemptRetryOnResponse
Observe infinite looping
Expected behavior
I expected that after maxRetryAttempts attempts of the original request, the request would be cancelled
I tried to open a PR to fix this on the master branch but I noticed the project is taken over by AI Slop and the code was very different between what's published on pub ( 2.0.0 ) and master.
Yeah, there was an attempt to fix things using AI when it wasn't properly handled. That and the fact that the API decisions made in the past by myself were not the best. It led the library towards something much more cumbersome to maintain. I ended up rewriting most of it, keeping few things and will likely end 2.x version and its (very much lacking) support.
Activity
itsUndefined commentedon Sep 26, 2025
I fixed the issue locally by changing the method _attemptRequest to the following:
I also removed the global _retryCount variable.
I tried to open a PR to fix this on the master branch but I noticed the project is taken over by AI Slop and the code was very different between what's published on pub ( 2.0.0 ) and master.
CodingAleCR commentedon Mar 18, 2026
Yeah, there was an attempt to fix things using AI when it wasn't properly handled. That and the fact that the API decisions made in the past by myself were not the best. It led the library towards something much more cumbersome to maintain. I ended up rewriting most of it, keeping few things and will likely end 2.x version and its (very much lacking) support.
CodingAleCR commentedon Mar 18, 2026
Take a look at #173 if you are still interested, since I know it's been quite a while since you took interest in this 🙏🏼