-
Notifications
You must be signed in to change notification settings - Fork 2k
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
YMPT™: Yet More Progress Tweaks #1376
Conversation
This was accidentally broken in #1093
@@ -27,14 +27,14 @@ Object { | |||
"name": "foo.jpg", | |||
"preview": undefined, | |||
"progress": Object { | |||
"bytesTotal": 0, | |||
"bytesTotal": null, | |||
"bytesUploaded": 0, | |||
"percentage": 0, |
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.
Should all those be null
then? Otherwise bytesTotal
is null
, but bytesUploaded
is 0
?
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.
I only changed bytesTotal
because bytesUploaded: 0
is actually accurate, we did upload precisely 0 bytes, while bytesTotal: 0
was a lie (we don't know if the file is 0 bytes)
Thanks for attacking this! Crazy we didn’t have file sizes by accident for a while. |
YMPT™: Yet More Progress Tweaks
#1093 accidentally omitted file size reporting for GDrive/Dropbox uploads, which threw off client-side progress reporting. The first commit adds it back.
Unsized files (like instagram photos) now are stored with
size: null
instead of 0. Progress calculations usedbytesTotal == null
to check for unsized files, so this aligns the two properties. It also makes sure that unsized and 0-byte files are treated differently. Unsized files mean "this may be any size, we don't know" while empty files are just empty and we know it.We've had several PRs to this stuff now so it needs more tests to avoid breakage in the future. Opening as a draft PR now so the … progress … is visible.