-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
How to check condition for `No Internet Connection' #827
Comments
True this is the major problem dio is having, We can simply integrate Dio with connectivity package and before sending a request we can check for connection, if connection doesn't exists, then we can add a new DioError called NotConnectedException, which will give us the liberty to use it efficiently. |
@jaydangar I don't recommend using |
There's another package called data_connection_checker which involved the exact thing we want. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions. |
How is this automatically closed? No connection results in the most unwanted behaviour possible:
This behaviour is basically valid for any request, it just throws an error faster with smaller payload or GET requests. To me this makes this package unusable outside the most simplest requests. Dio simply does not implement the http correctly. There are e.g. options/pre-flight requests for exactly this reason. |
Hello, any news on this issue? I agree this is a major issue, it's making me rethink about using Dio in my app Thanks |
@demetrio812 yes this is a big problem i now i'm suffering and all my app writen wit Dio :/ i think change por http :/ |
Any progress? |
I'm also rethinking the use of Dio. I use it with Retrofit and not being able to handle the loss of internet, mid request or not, is making it hard to keep on using it. |
Still no update for this issue? |
Thanks for the feedback! Since Dio is an open source project, we of course accept contributions in this area. If you feel like the current implementation is lacking, feel free to create a pull request to improve it! |
will this issue ever be resolved? I am suffering from this issue as well even on latest dio: ^5.3.2 |
If you think this needs improvement, please open a new ticket with a reproducible test case. But I don't think there is much dio can do. |
New Issue Checklist
Issue Description and Steps
How to check condition for
No Internet Connection
usingDioErrorType
?The test case, when I
turn off the wifi and mobile data
.Code
e.type == DioErrorType.CONNECT_TIMEOUT || e.type == DioErrorType.RECEIVE_TIMEOUT
for handleTimeout
,yield MoviesError(e.toString());
for handleError
fromDio
. So how to handleNo Internet Connection
usingDioError
?The text was updated successfully, but these errors were encountered: