-
Notifications
You must be signed in to change notification settings - Fork 972
Return 0% when download totalBytes is 0 or undefined #10652
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10652 +/- ##
==========================================
+ Coverage 54.16% 54.17% +0.01%
==========================================
Files 247 247
Lines 21554 21558 +4
Branches 3338 3342 +4
==========================================
+ Hits 11674 11679 +5
+ Misses 9880 9879 -1
|
++ |
Actually I think we didn't used to show anything at all. Will this show 0% always for downloads that don't specify a content length in the reply? |
@bbondy i think it would have shown NaN% or Infinity% previously |
I mean originally we didn't show anything at all. There is a case where there is no known % because we don't know the content length being downloaded. For example if that happens with a 3GB file we shouldn't show 0% the whole time it is downloading. Do you know if that will happen? |
@bbondy pretty sure that is unaffected by this PR. looks like that check happens in app/renderer/components/download/downloadItem.js using totalBytes |
Auditors: @diracdeltas Test Plan: `npm run unittest -- --grep="downloadUtil"`
1b947c9
to
2289c40
Compare
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.
Looks and works great! 😄
I updated the method to check for falsey input and then added some more tests in general (thanks for creating tests for this module!) 😄
Fix #10264
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
Download a large file and hit 'pause' immediately. It should not show Infinity% downloaded.
Reviewer Checklist:
Tests