Skip to content
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

Merged
merged 4 commits into from
Apr 4, 2019
Merged

YMPT™: Yet More Progress Tweaks #1376

merged 4 commits into from
Apr 4, 2019

Conversation

goto-bus-stop
Copy link
Contributor

@goto-bus-stop goto-bus-stop commented Mar 25, 2019

#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 used bytesTotal == 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.

@@ -27,14 +27,14 @@ Object {
"name": "foo.jpg",
"preview": undefined,
"progress": Object {
"bytesTotal": 0,
"bytesTotal": null,
"bytesUploaded": 0,
"percentage": 0,
Copy link
Contributor

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?

Copy link
Contributor Author

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)

@arturi
Copy link
Contributor

arturi commented Mar 26, 2019

Thanks for attacking this! Crazy we didn’t have file sizes by accident for a while.

@goto-bus-stop goto-bus-stop marked this pull request as ready for review April 1, 2019 13:12
@arturi
Copy link
Contributor

arturi commented Apr 4, 2019

I’ve gotten this:

Screen Shot 2019-04-04 at 13 05 15

and other weird 1260% a couple of times, but can’t reproduce consistently. Merging and will see on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants