Skip to content

Multiple API requests are happening while trying to upload a file in the latest beta version of "flutter_uploader" #142

Open
@ganeshrvel

Description

@ganeshrvel

I tried to use the package (latest beta versions) in my application. The events are emitting correctly but the package is making huge amount of network requests while the file is being uploaded.

I noticed that the package made around 92 API requests under 5 seconds!!
I am attaching a redacted API request log along with the issue. Log: uploader.log

Phone: "Oneplus 6"
OS: "Android 10"

code:

      final flutterUploader = FlutterUploader();

      final taskId = await FlutterUploader().enqueue(
        MultipartFormDataUpload(
          url: 'https://url.com/post',

          files: [
            FileItem(
              path: '/path/to'
              field: 'field',
            )
          ],

          method: UploadMethod.POST,

          headers: {},

          data: {},

          tag: 'tag_name',
      );

      final subscription = flutterUploader.progress.listen((progress) {
        print('============');
        log.print('progress.progress subscription', '${progress.progress}');
        log.print('progress.status subscription', '${progress.status}');
        print('============');
      });


      final result = flutterUploader.result.listen((progress) {
        print('============');
        log.print('progress.response result', '${progress.response}');
        log.print('progress.status result', '${progress.status}');
        log.print('progress.statusCode result', '${progress.statusCode}');
        print('============');
      });

Both the stable (#141) and beta versions have blockers due of which we aren't being able to use the package in out application. What do we do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    androidAndroid-only issuesbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions