dio
dio copied to clipboard
Browser adapter time out
New Pull Request Checklist
- [X ] I have read the Documentation
- [X ] I have searched for a similar pull request in the project and found none
- [X ] I have updated this branch with the latest
develop
to avoid conflicts (via merge from master or rebase) - [X ] I have updated the documentation (if necessary)
- [X ] I have run the tests and they pass
This merge request fixes the browser adapter time outs broken from since 4.0.4.
Pull Request Description
Since version 4.0.4, browser adapter is a bit broken regarding time outs and the 'response' completer. Using cache, for example, may lead to already completed future. Connect timeout is launch without any control, etc.
This PR applies the following changes:
- Complete the time outs in every situation.
- Ensure that we do NOT complete more than once the completer.
- Cleanup
fetch
method to be more readable regarding time outs. - Remove XHR timeout which is wrongly configured and not really used anyway (because of completer)
- Some more tiny cleanups (print, format 80 cols, final, ...).
Would greatly appreciate if this was merged
Thanks for your PR, it fixed the problem borthering me the whole day.
@wendux
This should be merged.... I spent all day on a bug, this one fixed it, I hope it can be merged, because Dio is worth it.
Error: Bad state: Future already completed