Skip to content

[Storage]: Multi-part upload results in many progress updates with 100% status #2869

@mattcreaser

Description

@mattcreaser

Before opening, please confirm:

Language and Async Model

Kotlin

Amplify Categories

Storage

Gradle script dependencies

// Put output below this line

Environment information

# Put output below this line


Please include any relevant guides or documentation you're referencing

No response

Describe the bug

When uploading a file over 5mb Amplify performs a multi-part upload. When this upload completes there are multiple progress updates sent in a burst with a completion percentage of 100%. The number of such updates appears to be proportional to the size of the file - for a file measuring 472mb, I noted that this resulted in several hundred callbacks.

There should only be one progress update sent with a completion percentage of 100%.

Reproduction steps (if applicable)

  1. Create an app that can upload a file to S3 with Amplify
  2. Attempt to upload a file that is >= 5mb. This will result in a multi-part upload.
  3. Observe the progress updates received. Note that there are multiple callbacks with progress == 1.0. The larger the file, the higher the number of such callbacks received.

Code Snippet

Amplify.Storage.uploadFile(
    StoragePath.fromString(path), 
    file, 
    StorageUploadFileOptions.defaultInstance(),
    { Log.i("MyAmplifyApp", "Fraction completed: ${it.fractionCompleted} (${it.currentBytes} / ${it.totalBytes})") },
    { Log.i("MyAmplifyApp", "Successfully uploaded: ${it.path}") },
    { Log.e("MyAmplifyApp", "Upload failed", it) }
)

Log output

// Put your logs below this line


amplifyconfiguration.json

No response

GraphQL Schema

// Put your schema below this line

Additional information and screenshots

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingstorageRelated to the Storage category/plugins

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions