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
[TIMOB-17327]: Add ceiling and floor to httpClient's onDataStream progress #6424
Conversation
Test comment. |
Test response |
Waiting for CLA hook to kick in. Think it takes 5 minutes. |
👍 |
And trying again. |
Attention: The contributor has signed the CLA |
Attention: The contributor has signed the CLA |
double currentProgress = ((double)progress)/totalLength; | ||
// cap progress to 1 and floor at 0 | ||
if (currentProgress > 1 || currentProgress < 0) { | ||
currentProgress = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it's default to 1 when the calculated progress is invalid in "onsendstream", but default to -1 in "ondatastream"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In ondatastream
we do this because sometimes we do not get content-length and it creates crazy values. in onsendstream
we always know what the size is, so just adding this as a check. Per Vishal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No matter why we fall into this invalid value situation, it is still invalid. So in my opinion, once the value is invalid, we set it to the NetworkModule.PROGRESS_UNKNOWN constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After talking to Vishal, we are going to remove the check for 0-1 in upload progress. It should never be outside that range, but if it is, it is a bug and we want to see it.
Reviewed and ran validate. DR passed. |
CR passed. |
[TIMOB-17327]: Add ceiling and floor to httpClient's onDataStream progress
https://jira.appcelerator.org/browse/TIMOB-17327
#6364 + floor