Fenix: FNX2-13354 ⁃ [Bug] Negative Downloading Progress while downloading from GoogleDrive links

Created on 1 Jun 2020  Â·  34Comments  Â·  Source: mozilla-mobile/fenix

Steps to reproduce

Open any video link of drive.google.com, and click download logo on the website page
For eg. This link - https://drive.google.com/file/d/19dDJMxNTEI04_a6A3NScrOufHl5qiEyd/view?usp=drivesdk

Expected behavior

The download progress should be real 'between' 0 to 100%.

Actual behavior

The download progress is a long negative number. Screenshot attached
ScreenshotUNITO-UNDERSCORE!20200601-124440!

Device information

  • Android device: 10
  • Fenix version: 5.0.0
E5 Download engverified 🐞 bug

Most helpful comment

@AdityaGupta150 you're suspecting that the Drive isn't sending the file size info then how come I'm able to the see the file size info on ADM? through its built-in browser add the download task and it says that the file is about 64.8 MB.

The bug still reproduces on Nightly 200610 06:00.

All 34 comments

Relating to this, there is a linearity even in the negative numbers shown - Download Percentage increases in magnitude, as the download progresses.
Also, this doesn't seem to be a problem on other websites, while downloading.

I can reproduce this issue on Motorola One Power, Android 10.

Fenix: 5.1.0-beta.3 and Nightly 200601 06:00

I can reproduce this issue on Motorola One Power, Android 10.

Fenix: 5.1.0-beta.3 and Nightly 200601 06:00

Has it been fixed in the beta (in your case)?

@AdityaGupta150 No. Is it possible that it is a device specific issue? I'm gonna test this on a few more devices.

@AdityaGupta150 I can also reproduce this on Realme C3, Android 10.

We opened a bug https://bugzilla.mozilla.org/show_bug.cgi?id=1632594 on geckoView some time ago for that. The bug is now fixed, we have to double check if resolved the issue and if it is linked to this one.

@Amejia481 It is still present, when downloading any kind of file from google drive.
Furthermore, when i tried the same with the desktop version, i thought a possible reason maybe that - Drive doesn't send the _total size_ of the file, and hence the desktop version firefox manages this by not showing total size, and that 'Unknown time left'. _Maybe_ fenix is not managing that currently.
While trying further to know of this, this answer tells this -

When you download a file without seeing the final file size, then the server side is actually not sending this information along with the file that you're downloading.

As a programmer sometimes I do not know the final file size because I create the download results on the fly

*I had seen similar behaviour while downloading a file, from MS Sharepoint, but can't try that now.
These were what i thought, pardon if it's completely off-topic

@AdityaGupta150 you're suspecting that the Drive isn't sending the file size info then how come I'm able to the see the file size info on ADM? through its built-in browser add the download task and it says that the file is about 64.8 MB.

The bug still reproduces on Nightly 200610 06:00.

@SS1113 Yes, a response from content.googleapis.com had the attribute 'fileSize: 67908429'.
*Additionally, still Firefox _desktop_ doesnt show the total size.

Just saw this on 6/8 Nightly, so this is a different problem from the one that GV fixed.

I think @AdityaGupta150's investigation is correct - Desktop Firefox uses an indeterminate progress bar for files like this (where the size is not listed in the download dialog). Fenix should do the same.

I know Fenix does have an indeterminate progress bar, so this seems like a regression.

@sblatz since you did downloads, did we have an indeterminate progress bar and this is a regression, or am I misremembering?

@AdityaGupta150 I just checked Chrome on Android also does the same thing. Chrome show a indefinite progress bar which has "amount of file downloaded/?" ( See the screenshot).

I'm yet to check it on desktop but I can confirm that I have seen several instances of downloads on desktop Firefox which don't have any file size but on a third-party download manager they show their download size.

I think @AdityaGupta150's investigation is correct - Desktop Firefox uses an indeterminate progress bar for files like this (where the size is not listed in the download dialog). Fenix should do the same.

@liuche if third-party download managers _are_ able to display the download file size then how come built-in download manager are not able to do so? Isn't it considered as a defect?

Fenix should do the same.

Just because Chrome on Android or Firefox on desktop does behave this way doesn't mean it's a good idea to follow them on Fenix as well. I don't think it's a good idea to do it on a mobile device since mobile devices primarily use mobile networks to connect to internet at least where I live ( and you _know_ how expensive they can be most of the time). Not displaying the file size always will make it seem like the file could be of small size (at least that's what I used to think) so users will exhaust their limited data packs really easily on 4G networks since they could be _really_ fast sometimes đŸ€”. I know file sizes cannot always be displayed but considering this case the third-party download managers _are_ able to display it properly then I think Fenix should be able to do the same thing.

We definitely used to show an indeterminate bar if the download file size could not be determined. Perhaps that was regressed?

@Amejia481, @kglazko

We will take a look at it in the next ac spring :)

@Amejia481 It is still present, when downloading any kind of file from google drive.
Furthermore, when i tried the same with the desktop version, i thought a possible reason maybe that - Drive doesn't send the _total size_ of the file, and hence the desktop version firefox manages this by not showing total size, and that 'Unknown time left'. _Maybe_ fenix is not managing that currently.
While trying further to know of this, this answer tells this -

When you download a file without seeing the final file size, then the server side is actually not sending this information along with the file that you're downloading.
As a programmer sometimes I do not know the final file size because I create the download results on the fly

*I had seen similar behaviour while downloading a file, from MS Sharepoint, but can't try that now.
These were what i thought, pardon if it's completely off-topic

I could confirm that this is the case, the issue is still present. I reopened the bug on the GeckoView issue, I additionally I'm adding an extra validation for avoiding this cases, on AC.

Just saw this on 6/8 Nightly, so this is a different problem from the one that GV fixed.

I think @AdityaGupta150's investigation is correct - Desktop Firefox uses an indeterminate progress bar for files like this (where the size is not listed in the download dialog). Fenix should do the same.

I know Fenix does have an indeterminate progress bar, so this seems like a regression.

@sblatz since you did downloads, did we have an indeterminate progress bar and this is a regression, or am I misremembering?

@liuche for this case we have an indeterminate progress bar but as we were getting a negative number from GV (see) the indeterminate progress bar wasn't showing.

This issue will be addressed when https://github.com/mozilla-mobile/android-components/pull/7400 lands and we update to the new ac version

@Amejia481 Sorry if I'm annoying, I'm not a developer so I don't know how the software development works. I'm just talking from the user's point of perspective.

Is it really not possible to display the download size in this case? If so then how can third-party download managers are able to do so ? I'm just curious.

I too think, that if possible, this should be tried to.

@SS1113 Yes, a response from content.googleapis.com had the attribute 'fileSize: 67908429'.
*Additionally, still Firefox _desktop_ doesnt show the total size.

Maybe, if the response containing the file doesn't have the file size, maybe look other responses from the download page, if it's not much impact on performance (like download managers may be doing)?
@SS1113 Maybe that should be made into a feature request issue?

@SS1113 Maybe it should be made into a feature request issue?

@AdityaGupta150 yeah, if the developers give an okay then I'll file a new issue. I don't want to file issues/feature requests which developers aren't willing to consider.

@Amejia481 Sorry if I'm annoying, I'm not a developer so I don't know how the software development works. I'm just talking from the user's point of perspective.

Is it really not possible to display the download size in this case? If so then how can third-party download managers are able to do so ? I'm just curious.

Thanks @SS1113 for taking our opinion into consideration.
Showing the size of the file is not a big change, in terms of development. But it's a product decision @brampitoyo can help us in that aspect. For more context take a look at https://github.com/mozilla-mobile/fenix/issues/11107#issuecomment-643012801

File size
image

Percentage

image

This is no longer reproducing on Nightly 200617 18:01. Tested on Motorola One Power, Android 10. Thanks for fixing it!

@SS1113 Thanks for bringing this to our attention again.

I agree with @Amejia481. Download progress is something that we want to show in the Android notification shade, if it’s not hard to do.

As far as I understood, we didn’t show exact progress the first time around because we needed to limit our project scope. But now could be a good time to enhance the download manager with more information, and this feature would make for a good starting point.

I was able to reproduce this issue on Fenix Release build with Nokia 6 (Android 5.1.1) and Samsung Galaxy Note 10 (Android 10) and here is a video with the results on Nightly 6/18: the download progress is not shown and when the file is downloaded, the size is null.
Note that on an older build, the size was a negative number.

ezgif com-video-to-gif

Screenshot file size - Fenix Release.
Screenshot_20200618-175648

@SS1113 Thanks for bringing this to our attention again.

I agree with @Amejia481. Download progress is something that we want to show in the Android notification shade, if it’s not hard to do.

As far as I understood, we didn’t show exact progress the first time around because we needed to limit our project scope. But now could be a good time to enhance the download manager with more information, and this feature would make for a good starting point.

@brampitoyo I'm not sure if you understood this correctly. The download progress/size is already shown except for this issue but I'm not talking about the download progress here.

In this particular issue the download progress should be correctly shown (but negative values are being shown instead, which seems to fixed now and now it displays an infinite progress bar) including the file size which fenix fails to do now.

Fenix is currently not showing the file size for this particular issue currently but instead shows an infinite progress bar but third-party download managers are able to show the download size correctly, that's what I think the Fenix also should be able to do.

@SS1113 I was talking about the infinite progress bar, and the fact that we didn’t show it the first time around. Sorry if that wasn’t unclear. We do want to show an exact progress bar, if possible.

@SS1113 Thanks for bringing this to our attention again.
I agree with @Amejia481. Download progress is something that we want to show in the Android notification shade, if it’s not hard to do.
As far as I understood, we didn’t show exact progress the first time around because we needed to limit our project scope. But now could be a good time to enhance the download manager with more information, and this feature would make for a good starting point.

@brampitoyo I'm not sure if you understood this correctly. The download progress/size is already shown except for this issue but I'm not talking about the download progress here.

In this particular issue the download progress should be correctly shown (but negative values are being shown instead, which seems to fixed now and now it displays an infinite progress bar) including the file size which fenix fails to do now.

Fenix is currently _not_ showing the file size for this particular issue currently but instead shows an infinite progress bar but third-party download managers are able to show the download size correctly, that's what I think the Fenix also should be able to do.

@SS1113 We are showing the infinitive progress bar as the website is not providing us the file size see. I'm working on fixing the "null" text on the downloaded dialog.

ezgif com-video-to-gif

This should be fixed in nightly. QA please help us to verify.

@SS1113 I was talking about the infinite progress bar, and the fact that we didn’t show it the first time around. Sorry if that wasn’t unclear. We do want to show an exact progress bar, if possible.

@brampitoyo I just want to confirm. Should we show the file size instead of the progress in percentage? See the two images in https://github.com/mozilla-mobile/fenix/issues/11107#issuecomment-644831806

@Amejia481 this is fixed on my device.

Fenix: Nightly 200706 06:01.

Device: Motorola One Power, Android 10

Screenshot_20200706-192649
Screenshot_20200706-192527

@Amejia481 Thanks. This looks great! Let’s show file size in the notification shade, as the download bar underneath already gives a sense of progress.

@Amejia481 Thanks. This looks great! Let’s show file size in the notification shade, as the download bar underneath already gives a sense of progress.

@brampitoyo Are you going to show the download progress size as the download progresses like; 2MB of 200MB has downloaded and show the progress bar with respect to how much of the file has been downloaded? Just like how the "File size" screenshot shows in the above comment. Or will just show that the file is of 200MB and show the progress bar?

@SS1113 We will show the current downloaded size in respect to the total file size, as in the examples below:

527 KB / 7.6 MB
1.52 MB / 200 MB

Awesome thanks @brampitoyo.
@SS1113 feel free to open an issue for the feature request :)

Verified as fixed on Nightly 7/7 with Samsung Galaxy Note10(Android 10).

Was this page helpful?
0 / 5 - 0 ratings