Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On IOS After closing internet Connection Timeout does not work with uploading or downloading file to/from server. #1952

Closed
ghost opened this issue Sep 5, 2023 · 2 comments

Comments

@ghost
Copy link

ghost commented Sep 5, 2023

Package

dio

Version

5.3.2

Output of flutter doctor -v

[✓] Flutter (Channel stable, 3.13.2, on macOS 13.5 22G74 darwin-x64, locale en-PK)
    • Flutter version 3.13.2 on channel stable at /Users/mac/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ff5b5b5fa6 (12 days ago), 2023-08-24 08:12:28 -0500
    • Engine revision b20183e040
    • Dart version 3.1.0
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/mac/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.81.1)
    • VS Code at /Users/mac/Downloads/Visual Studio Code.app/Contents
    • Flutter extension version 3.72.0

[✓] Connected device (3 available)
    • iPad (mobile)   • c484fc9175af0406e9a9afc9b14328a6ae72695e • ios            • iOS 15.7 19H12
    • macOS (desktop) • macos                                    • darwin-x64     • macOS 13.5 22G74 darwin-x64
    • Chrome (web)    • chrome                                   • web-javascript • Google Chrome 116.0.5845.140

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Dart Version

3.1.0

Steps to Reproduce

//Uploading file to presigned url

try {
      final response = await dio.put(
        'url',
        data: File(file.filePath).openRead(),
        options: Options(
          contentType: file.mimeType,
          sendTimeout: Duration(seconds: 5),

          headers: {
            "Content-Length": File(file.filePath).lengthSync(),
          },
        ),
   
      );
     
    } catch (e) {
      if (kDebugMode) {
        print("error ${e.toString()}");
      }
      rethrow;
    }

//Downloading file from presigned url

final response = await dio.download(
      'download_url',
      'savedPath',
      options: Options(receiveTimeout: Duration(seconds: 5)),
    );

Expected Result

On IOS it must throws an error after 5 seconds if internet turns off.

Actual Result

it throws error after 5 seconds if uploading/downloading not completed in duration with the availability of internet.

@ghost ghost added h: need triage This issue needs to be categorized s: bug Something isn't working labels Sep 5, 2023
@ENUUI
Copy link

ENUUI commented Sep 8, 2023

The issue is also reproducible in version 4.0.6.

@AlexV525
Copy link
Member

The flow is connect -> send/receive, so it should be connectTimeout here.

@AlexV525 AlexV525 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 14, 2023
@AlexV525 AlexV525 added i: not reading documents and removed h: need triage This issue needs to be categorized s: bug Something isn't working labels Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants