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

WIP: Fix dio 4.0.0 breaking changes #39

Merged
merged 4 commits into from
Apr 10, 2021

Conversation

cmengler
Copy link
Contributor

No description provided.

@cmengler cmengler requested a review from felangel as a code owner March 30, 2021 10:26
Future<dynamic> onResponse(
Response response,
ResponseInterceptorHandler handler,
) async {
if (await token == null || !_shouldRefresh(response)) {
return response;
}
return _tryRefresh(response);
Copy link
Owner

@felangel felangel Mar 30, 2021

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.

Copy link
Contributor Author

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 :)

Copy link
Owner

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 👍

Copy link
Contributor Author

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! 💯 🚀

@felangel felangel added the enhancement New feature or request label Mar 30, 2021
@cmengler cmengler changed the title Fix dio 4.0.0 breaking changes WIP: Fix dio 4.0.0 breaking changes Mar 30, 2021
felangel
felangel previously approved these changes Apr 10, 2021
@felangel felangel linked an issue Apr 10, 2021 that may be closed by this pull request
@felangel felangel merged commit 9e863b2 into felangel:master Apr 10, 2021
@cmengler cmengler deleted the fix-fresh_dio-dio-4.0.0 branch April 12, 2021 10:29
try {
_httpClient.lock();
refreshedToken = await _refreshToken(await token, _httpClient);

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?

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

Successfully merging this pull request may close these issues.

Migrate to dio 4.0.0
4 participants