kotelnik / firefox-extension-unity-launcher-api-e10s

Unity LauncherAPI add-on for Firefox, compatible with e10s.
GNU General Public License v3.0
5 stars 1 forks source link

Problem with cancelled downloads #3

Open mtijink opened 7 years ago

mtijink commented 7 years ago

Cancelled downloads still show up as in-progress in the taskbar. I think a better approach would be removing it, or showing it as red until the user interacts with firefox again (and then removing it).

kotelnik commented 7 years ago

I agree cancelled or failed downloads shouldn't show up in taskbar as in-progress. But I cannot replicate such behaviour.

If I manually cancel a download, it vanishes from my (KDE Plasma) taskbar. So it looks more like an Firefox Download API misbehaviour since I actually filter only download objects with "in_progress" state and pass them to taskbar in the addon code.

Maybe I did not try every use-case. Can you please post exact steps to simulate the issue?

mtijink commented 7 years ago

You are right, it does not happen for cancelled downloads, but it does happen for failed downloads.

To replicate: download something, and make sure your internet connection drops. This is kinda hard, since firefox asks NetworkManager (?) for the connection status and pauses the download if it says there is no connection. For me, making sure the router did not have internet, but the network still worked, did the trick.

Note that firefox itself handles these downloads differently than cancelled/paused downloads: after restarting firefox, the failed download still shows up under the downloads button. Also, removing the failed download from the list also removes the (1) and progress.

kotelnik commented 7 years ago

Thanks for the extensive info! I was able to replicate and I believe I've made a fix. Hopefully it will be soon available in signed form (and hopefully i really fixes the issue:D).

marhkb commented 7 years ago

Is this resolved? I am using 1.1.3-1 from AUR and always have an empty batch in the firefox launcher

kotelnik commented 7 years ago

Yes, version 1.1.3 should fix the problem with cancelled downloads. Please make sure, that 1.1.3 is also the version of the add-on inside Firefox. And if versions are fine, please describe more in detail what problem do you have. Empty batch means counter and no progress? Is it connected with failed/canceled downloads? If it is possible, please describe the steps to reproduce. Or is it the exact same problem described in this issue and the fix is just not working for you?

marhkb commented 7 years ago

Ok, maybe it is just a bug in latte-dock. I figured out that standard plasma panel behaves correctly. I have made a video. What do you think? In firefox version 1.1.3 is shown as expected.

badge.tar.gz

EDIT: removing cancelled Downloads does not help even if firefox is restarted after that. The empty badge even keeps sitting in pinned firefox launcher. Also the issue does not occur in some cases (maybe 1 out of 6).

kotelnik commented 7 years ago

(Sorry for my late response.) Then it looks like latte-dock is not disappearing the badge every time. It should respond to this command to hide the bagde:

gdbus emit --session --object-path / --signal com.canonical.Unity.LauncherEntry.Update firefox "{'progress-visible': <'false'>, 'count-visible': <'false'>, 'count': <'0'>, 'progress': <'0'>}"

I'll try to ask on their github.

kotelnik commented 7 years ago

Sorry, my bad. I just realized that the empty badge is caused by calling non-zero progress in the end of downloading. I'll fix that in next version of this add-on. Thanks for reporting this!

marhkb commented 7 years ago

when are you planning to release?

kotelnik commented 7 years ago

Sorry for my late response. I've just posted this update for Mozilla review. It will become available in Firefox store after the review is done.

kotelnik commented 7 years ago

Just a reminder: the bug where failed downloads are showed as in_progress (visible count in taskbar) will appear again until this Firefox bug is fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1373953

Although unknown-total-size downloads should now be noted in taskbar and latte dock badge should be gone when no downloads are happening.