dio
dio copied to clipboard
Isolate hangs when responding to large json
Package
dio
Version
5.8.0+1
Operating-System
Android
Adapter
Default Dio
Output of flutter doctor -v
Flutter (Channel stable, 3.35.1, on macOS 15.5 24F74 darwin-arm64, locale zh-Hans-MO) [337ms]
• Flutter version 3.35.1 on channel stable at /Users/xxx/fvm/versions/stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 20f8274939 (5 weeks ago), 2025-08-14 10:53:09 -0700
• Engine revision 1e9a811bf8
• Dart version 3.9.0
• DevTools version 2.48.0
• Feature flags: no-enable-web, no-enable-linux-desktop, no-enable-macos-desktop, no-enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-lldb-debugging
Dart Version
3.9.0
Steps to Reproduce
1.open app
2.Mobile lock screen
3.Wait a moment,Unlock screen,send a dio request with response body size Larger, The specific threshold is unclear ,and response type is json,content-type is json
4.this dio request no result,
Expected Result
over the receiveTimeount should be return
I found ,the lock screen caused "Lost Device",then back app use isolate will hang. I don't have this problem when I use the official dart http library
Actual Result
No results
Subsequent large response requests have no results unless the App is restarted
me too
我找到原因了,是因为小json会消耗更多资源,下面的方案解决了我的问题