-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
WIP: Fix dio 4.0.0 breaking changes #39
Conversation
Future<dynamic> onResponse( | ||
Response response, | ||
ResponseInterceptorHandler handler, | ||
) async { | ||
if (await token == null || !_shouldRefresh(response)) { | ||
return response; | ||
} | ||
return _tryRefresh(response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, thanks for taking the time to make these changes! Have you verified that the example runs properly and refreshes/revokes correctly? I believe rather than returning that we should use the handlers
in the various dio hooks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! You're 100% correct, I'll work on the required changes and update PR :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I believe I've updated your implementation to address these issues and plan to publish a stable version very soon 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome job! Apologies for not getting back to this sooner -- Love your speedy work! 💯 🚀
try { | ||
_httpClient.lock(); | ||
refreshedToken = await _refreshToken(await token, _httpClient); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seem that my refresh requests are not sent anymore after updating. I assume this is caused by the lock. The _httpClient
instance is locked so I have to use another instance to make the refresh request?
No description provided.