Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry callback bug #4

Open
rodion-m opened this issue Nov 25, 2019 · 9 comments
Open

Retry callback bug #4

rodion-m opened this issue Nov 25, 2019 · 9 comments
Labels
bug Something isn't working

Comments

@rodion-m
Copy link

rodion-m commented Nov 25, 2019

Hello! I found a bug with a retry callback. The module do only one call of given callback, after that it uses a default callback.
Here is a bugged code:
var shouldRetry = extra.retries > 0 && await extra.retryEvaluator(err);
to fix it we just have to change extra to options:
var shouldRetry = extra.retries > 0 && await options.retryEvaluator(err);

@aloisdeniel aloisdeniel added the bug Something isn't working label Nov 25, 2019
@aloisdeniel
Copy link
Owner

Thank you, I will fix that. :)

@rodion-m
Copy link
Author

rodion-m commented Nov 25, 2019

Thank you, I will fix that. :)

You are welcome and thank you for a useful module!

@carmas123
Copy link

Sorry but when you release this fix on Pub?

@jatin-kataria-sc
Copy link

var shouldRetry = extra.retries > 0 && await options.retryEvaluator(err);

where to change this

@jatin-kataria-sc
Copy link

i have tried but the function api is nhi been
retries

@jatin-kataria-sc
Copy link

on 404 it only retries only once

Aqua-Ye added a commit to Aqua-Ye/dio_retry that referenced this issue Apr 22, 2020
@azimuthdeveloper
Copy link

azimuthdeveloper commented Oct 20, 2020

I fixed this in my branch by manually applying the PR. Here's how to use it in your project. You can use my patched version by adding this to your pubspec.yaml instead of the existing dio_retry package.

  dio_retry:
    git:
      url: https://github.com/lewcianci/dio_retry.git
      path: dio_retry

@azimuthdeveloper
Copy link

azimuthdeveloper commented Oct 23, 2020

I also removed the dependency on logger in my fork. I prefer a more generic callback.

EDIT: I bit the bullet and published it to pub dev, you can grab it here if you want: https://pub.dev/packages/dio_retry_fixed

@scaraux
Copy link

scaraux commented Dec 9, 2020

@aloisdeniel any idea when you can get this fixed? Would be awesome to have it on prod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants