You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should change the return type of typedef OnHttpClientCreate = HttpClient? Function(HttpClient client); not non-nullable HttpClient. Keeping it nullable makes no sense is probably a leftover of the NNBD migration.
Currently we create a new HttpClient for every request where a CancelToken is provided. In Dart 2.10 an API to abort requests was added, we should use HttpClientRequest.abort when the CancelToken is cancelled
Solution Brainstorm
No response
The text was updated successfully, but these errors were encountered:
The return type of `OnHttpClientCreate` has been changed from
`HttpClient?` to `HttpClient`.
While technically a breaking change, it is considered a bug because the
callback was actually
a no-op when the provided client was modified but not returned.
Fixes 1. of #1811
### New Pull Request Checklist
- [x] I have read the
[Documentation](https://pub.dev/documentation/dio/latest/)
- [x] I have searched for a similar pull request in the
[project](https://github.com/cfug/dio/pulls) and found none
- [x] I have updated this branch with the latest `main` branch to avoid
conflicts (via merge from master or rebase)
- [ ] I have added the required tests to prove the fix/feature I'm
adding
- [x] I have updated the documentation (if necessary)
- [x] I have run the tests without failures
- [x] I have updated the `CHANGELOG.md` in the corresponding package
Request Statement
typedef OnHttpClientCreate = HttpClient? Function(HttpClient client);
not non-nullableHttpClient
. Keeping it nullable makes no sense is probably a leftover of the NNBD migration.HttpClient
for every request where aCancelToken
is provided. In Dart 2.10 an API to abort requests was added, we should useHttpClientRequest.abort
when theCancelToken
is cancelledSolution Brainstorm
No response
The text was updated successfully, but these errors were encountered: