Isolate hangs when responding to large json

Open
#2,443 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
dart, flutter

Research direction

Start by reproducing the Dio request on Android with a large JSON response, locking and unlocking the screen, then inspect the default adapter's isolate behavior after the device is lost. Compare the result with Dart's official http library; done means the request returns the configured receive timeout instead of hanging.

Written by the indexing model from the issue text.

Description

h: need triage s: bug
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

Dominant language
Dart
Stars
12.8k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cfug/dio

All issues in cfug/dio

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.