-
Notifications
You must be signed in to change notification settings - Fork 549
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
S3 TransferUtility : TransferListener onProgressChanged gets invoked more than once #406
Comments
Hi @amankumarjain, Thank you for reporting to us. Few questions before we proceed: What version of SDK and Android are you using? |
|
Thank you for the detailed information @amankumarjain. Would you like to try our latest SDK 2.6.14 and see if it mitigates the progress update problem? We had few bug fixes around progress tracking fixed in 2.3.x and 2.4.x. Thanks. |
update to 2.6.14 still i am facing same problem
and TransferUtility is deprecated in this version, may i know whats the alternative for this. |
I did see that now in 2.3.+ version: (same behavior in 2.6.+ version)
The progress update happens for every certain X amount of bytes and the file if its smaller than the threshold, the progress update is made just once. For example the fule I uploaded is approximately 2.7MB so the progress was just instantaneous from 0 to 2.7MB but the onProgressChanged was called more than once (three times). Now I tried a file of 3.75MB
Now there were three progress updates: 0MB, 2.4MB, 3.75MB. But for the last progress update, it was called thrice. Now I tried a file of 294.18MB (video/mp4) The last few entries:
Overall it looks like there are duplicate callbacks getting invoked when the transfer finishes (mostly when state changes to COMPLETED). This might be a bug in the code where we invoke the onProgressChanged more than once. We are looking into it. For files < 5MB this appears like bytesCurrent == bytesTotal, but for files >= 5MB you can clearly see that we update progress as transfer progresses. |
I am uploading image file which will always be less than 256 kb. |
@amankumarjain Do you have any logs where uploading a file less than 256KB did not result in duplicate callbacks? |
now its not working as expected, i don't know what happened but previouslly it was not duplicate callbacks it was different callback with different currentBytes and totalBytes when i have implemented this i have tested it very properlly. now in my production app also this same error is hapenning, it started 2,3 days back previouslly it was running fine. |
Thank you @amankumarjain for the quick response. I could reproduce this issue easily in releases from 2.3.x to the latest. I am looking into the progress event and progress update code to find why the callback is invoked more than once especially during the finish of the transfer. I will update on this thread once I have the concrete the root cause. Thank you for the patience. You can however use the |
@amankumarjain I didn't see if your question about |
Hi @amankumarjain, We have identified the problem with the download operation. For every X bytes of data received over the network, the TransferUtility gets a callback which inturn calls the transfer listener that you have attached with the observer. In addition to this the thread that downloads the file updates the progress to bytesTotal after the file is saved to disk through the same interface, which makes an extra callback to the listener. Hence, you get duplicate callbacks when the download finishes. Same theory applied to the upload as well. We are working on to fix the problem. Thank you for your patience. |
@amankumarjain Sorry for the delay. I am working on a fix that would fix the duplicate callbacks in progress update along with the issue reported in #611 |
@amankumarjain I have fixed this issue in Root cause analysis:
Description of the fix: The fix involves
See 2.11.1 for more information. |
This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems. |
I am using S3 service
This is my code implementation
File is succesfully uploaded to s3 but observer onProgressChanged listener is returning same bytesCurrent and bytesTotal every time when onProgressChanged called.
The text was updated successfully, but these errors were encountered: