connectTimeout/receiveTimeout doesn't work
New Issue Checklist
- [X] I have searched for a similar issue in the project and found none
Issue Info
| Info | Value | |
|---|---|---|
| Platform Name | flutter / android | |
| Platform Version | 1.12.13+hotfix.8 / 7.0 | |
| Dio Version | 3.0.9 | |
| Repro rate | all the time (100%) |
Issue Description and Steps
Dio options:
__dio = Dio(BaseOptions(
headers: {"Accept": "application/json"},
responseType: ResponseType.json,
receiveTimeout: 30000,
connectTimeout: 5000,
followRedirects: false,
receiveDataWhenStatusError: true,
baseUrl: _baseUrl,
));
When my server takes more then 5s to process something, it fails with timeout. BUT the CONNECT timeout is 5s, not the RECEIVE timeout.
I expect that connect has resolved since it has successfully connected to the client (it didn't receive any response yet, hence the bigger receiveTimeout setting).
It seems a duplicate from #494 ?
Does it used to work in 2.x version?
i have the same issue in flutter 1.12.14. my device is android.
my app is linked to a Wifi which is not connected to internet. and i set the connnect timeout to 2 seconds. but the dio took almost 2 minutes to timeout.
i try it on dio 3.0.4/3.0.8/3.0.9, they all have the same problem
my debug info is below: `I/flutter (25438): [debug], [DioCloud], [Wed, 22 Apr 2020 06:10:57 GMT], request get, uri=/app/user/feedbacks, data=null, params={current: 1, size: 30}, headers=null
I/flutter (25438): connectTimeout, 2000 I/flutter (25438): {content-type: application/json; charset=utf-8, Authorization: eyJhbGciOyk}
I/flutter (25438): [debug], [DioCloud], [Wed, 22 Apr 2020 06:12:02 GMT], uri=/app/user/feedbacks, e=DioError [DioErrorType.DEFAULT]: SocketException: Failed host lookup: 'api.lebai.ltd' (OS Error: No address associated with hostname, errno = 7)
I/flutter (25438): [debug], [DioCloud], [Wed, 22 Apr 2020 06:12:02 GMT], e response=null`
It seems a duplicate from #494 ?
Does it used to work in 2.x version?
i have some problem, version v3.0.9. pls help to fix this
This is NOT about not working timeout! This is about connection timeout being different than receive timeout!!!
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.
Please do not close. Problem still persists in latest version.
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.
same problem in v3.0.9
Please reopen this issue
3.0.9 still has this problem,Please reopen this issue
This problem still exists in 3.0.9. Please reopen this problem. This problem will appear every time and is easy to find. Why not solve it as soon as possible?
3.0.9还存在此问题,请重新开启这个问题,这个问题必现,很容易发现,为什么不尽快解决呢?
3.0.9 still has this problem,Please reopen this issue
Please reopen this issues. am really facing problems with this
Same issue on 3.0.10
Please consider reopening this issue, or at least clarifying how connectTimeout works and/or pinning this issue. In my app, for operations involving potentially large images this issue caused intermittent crashes for some users (depending on their internet speed).
Not a great issue to debug because — like others — I assumed the connectTimeout was only relevant for actually connecting to the server. My server handled requests successfully so I did not figure out the actual issue until I logged errors in the app to the cloud.
version 3.0.10 Please resolve this bug.
This is still an issue! I'm having an issue with downloading. Connection timeout never throws an error and then receive timeout throws an error even in the middle of a successful download.
Has anyone found a workaround? I tried #844 but no luck.
Having the same problem anyone had success resolving it ?
Still not working to the lastest Dio version
The issue still exists in version 3.0.10