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
Please complete the following information):
- Flutter version: 3.35.4
- http_interceptor: 2.0.0