Memory issue when sharing CancelToken between posts for IO implementation #2111
Labels
b: regression
Worked before but not now
p: dio
Targeting `dio` package
platform: io
s: bug
Something isn't working
Package
dio
Version
5.4.0
Operating-System
Android
Output of
flutter doctor -v
Dart Version
3.1.3
Steps to Reproduce
Expected Result
No out of memory issues on Android.
Actual Result
Out of memory issues occur.
Dio's use of cancelFuture in dio/lib/src/adapters/io_adapter.dart differs from how it is used in browser_adapter.dart and exhibits different behavior. In IO, it captures on request in the callback to whenComplete in _fetch, which does not happen in the browser implementation.
This took us some time to discover as a memory leak issue. It would be great if this could be fixed, otherwise would love to see this documented so that future users will be aware of this issue.
The text was updated successfully, but these errors were encountered: