Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

_retryCount is shared between multiple requests making it dangerous to infinite requests #170

Copy link
Copy link

Description

@itsUndefined
Issue body actions

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

  1. Add a shouldAttemptRetryOnResponse that starts a new request with the same intercepted client that succeeds ( e.g. a refresh )
  2. Make an api request that fails all the time and calls shouldAttemptRetryOnResponse
  3. 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
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

Morty Proxy This is a proxified and sanitized view of the page, visit original site.