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

Request for clarification on QueuedInterceptor example #1543

Closed
1 task done
vasilich6107 opened this issue Aug 11, 2022 · 2 comments
Closed
1 task done

Request for clarification on QueuedInterceptor example #1543

vasilich6107 opened this issue Aug 11, 2022 · 2 comments

Comments

@vasilich6107
Copy link

vasilich6107 commented Aug 11, 2022

New Issue Checklist

  • I have searched for a similar issue in the project and found none

Issue Info

Hi. You have this example for queued interceptor.

https://github.com/flutterchina/dio/blob/a4392ff8412bfe1e3e86ae45f81fe1fc117bc56e/example/lib/queued_interceptor_crsftoken.dart

Issue Description and Steps

onError you are requesting new token with different Dio client called tokenDio
https://github.com/flutterchina/dio/blob/a4392ff8412bfe1e3e86ae45f81fe1fc117bc56e/example/lib/queued_interceptor_crsftoken.dart#L48

Does this mean that dio client is paused?

If the main dio client is paused why do you retry the failed request with dio client
https://github.com/flutterchina/dio/blob/a4392ff8412bfe1e3e86ae45f81fe1fc117bc56e/example/lib/queued_interceptor_crsftoken.dart#L53

Looks a little bit confusing.

Could you clarify why it works?
Why we can do retry with the same client but have to request token with different one?

@leyvaje
Copy link

leyvaje commented Dec 7, 2022

I am also having the same issue
+1 for clarification

@timnew
Copy link

timnew commented Dec 22, 2022

Agreed, we need more clarification on this.
The example code actually causes dead lock, which seems a design flaw to me:
#1612

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants