amplify-swift: Amplify Storage Progress either returns 0 or 100 nothing in between

Describe the bug

        let options = StorageUploadDataRequest.Options(accessLevel: .protected,
                                                       targetIdentityId: identityID)
        let uploadOperationTask = Amplify.Storage.uploadData(key: filename,
                                                             data: data,
                                                             options: options,
                                                             progressListener: { (progress) in
            progressHandler?(progress)
        }, resultListener: { (result) in
            switch result {
            case Result.success :
                completion(nil)
            case let Result.failure(error):
                completion(NetworkingError.apiError(description: error.errorDescription))
                print(error)
            }
        })
        return UploadTask(task: uploadOperationTask)

If the above is followed , and if the following contents of the progress object is printed

print("progress is ",progress.totalUnitCount,progress.fileCompletedCount, progress.completedUnitCount)

the output is

progress is 309536 nil 309536 progress is 309536 nil 309536

which means total progress calculated is always 100 , nothing in between

Steps To Reproduce

1. Upload a file
2. Print contents of the Progress object returned as shown above

Expected behavior

Progress object 's completed unit count should vary from 0 to totalUnitCount

Amplify Framework Version

1.18.1

Amplify Categories

Storage

Dependency manager

Cocoapods

Swift version

5.0

CLI version

7.6.5

Xcode version

13.2.1

Relevant log output

No response

Is this a regression?

No

Regression additional context

No response

Device

iPhone 8 Simulator

iOS Version

iOS 15.1

Specific to simulators

No response

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 25 (9 by maintainers)

Most upvoted comments

hey @atierian sorry for the long delay in replying , will test this and let you know in a while.