Bug 385530

Summary: Error message when I cancel a download manual
Product: [Plasma] plasma-browser-integration Reporter: Matthias <shalokshalom>
Component: FirefoxAssignee: Kai Uwe Broulik <kde>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.14.5
Sentry Crash Report:
Attachments: Notifications on manual interuption

Description Matthias 2017-10-09 18:14:01 UTC
Created attachment 108257 [details]
Notifications on manual interuption

I get error messages in FF 57, when I cancel a download. 
You also see a chrome error message, which is another issue.
Comment 1 Kai Uwe Broulik 2017-10-09 18:16:05 UTC
From what I can tell Firefox' API is identical to Chrome's here [1]. Need to further investigate.

[1] https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/downloads/InterruptReason
Comment 2 Kai Uwe Broulik 2018-11-29 10:39:56 UTC
I can reproduce the issue.
Comment 3 Kai Uwe Broulik 2018-11-29 10:45:44 UTC
Ok, the problem is that in Firefox I don't get the "interrupted" and "reason" information simultaneously but one after the other, so I first get "interrupted" at which point I'll try to read "reason" which I don't have and as such I'll cancel the download with "unknown" error.
Comment 4 Kai Uwe Broulik 2018-12-01 11:50:33 UTC
Git commit 90400518efcd2861ce1b7008f63a5710ad69e58a by Kai Uwe Broulik.
Committed on 01/12/2018 at 11:48.
Pushed by broulik into branch 'Plasma/5.14'.

Only cancel job when an "error" is set and ignore "interrupted"

In Chrome we get state change to "interrupted" and the error in unison whereas Firefox first signals
a state change and then updates the error later.

Previously, we would finish the job as soon as it was interrupted leading to a "unknown error"
any time a download aborted (even if explicitly canceled by the user).

According to documentation the "error" is set in case of an error, so we'll want to cancel the job in this case.

CHANGELOG: Fixed cancelling download in Firefox showing an "unknown error" notification
FIXED-IN: 5.14.5

Differential Revision: https://phabricator.kde.org/D17233

M  +57   -59   host/downloadjob.cpp

https://commits.kde.org/plasma-browser-integration/90400518efcd2861ce1b7008f63a5710ad69e58a