-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
fresh_dio - Dio instance locked #46
Comments
You can just call |
Also before migrating to dio 4.0.0 there was not any locking (see https://github.com/felangel/fresh/blob/f2470c98cb94a315ebbfbca7e3bc82aea18b0dc5/packages/fresh_dio/lib/src/fresh.dart) |
There is also another bug which I fixed in PR with adding refreshed token to headers. For some reason, it disappeared after this commit b457b26 |
This should be fixed as part of #45 and included in v0.3.1 👍 |
In the lastest 0.3.0 null-safety release, the Dio client is locked from making requests before refreshing the token.
Sadly this also includes the token refresh request itself.
Also see: https://github.com/felangel/fresh/pull/39/files#r614289083
There is an open PR #45 which removes the locking.
In general I think it is a good idea to lock the instance but it should occur after the refresh request is sent and unlocked after the response is received and the token is stored.
As a workaround a new Dio instance can be constructed.
The text was updated successfully, but these errors were encountered: