Bug 401038

Summary: New notification not created when a failed download is resumed
Product: [Plasma] plasma-browser-integration Reporter: Sipho Mateke <siphomateke>
Component: ChromeAssignee: 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:
Sentry Crash Report:

Description Sipho Mateke 2018-11-14 16:44:09 UTC
SUMMARY
When a download fails due to a network error and is then restarted, plasma-browser-integration doesn't create a new notification.

STEPS TO REPRODUCE
1. Start a download
2. Cause a network error (not sure how to do this exactly) to make the download fail
3. Fix the network error
4. Resume the download

OBSERVED RESULT
No new notification is created after resuming the download.

EXPECTED RESULT
A new notification is created just like when a download is started.

SOFTWARE/OS VERSIONS
OS: Kubuntu 18.10 with backports
KDE Plasma Version: 5.14.3
KDE Frameworks Version: 5.51.0
Qt Version: 5.11.1
Comment 1 Kai Uwe Broulik 2018-11-14 17:38:31 UTC
I assume we don't get a download created event then but instead have a change in the state of an existing download which we might not be monitoring or processing correctly. (Actually I have never managed to resume an aborted download in Chrome..)
Comment 2 Kai Uwe Broulik 2018-11-15 18:47:43 UTC
Git commit 2b15d99afd539323481efdeeebd915493a0b9d40 by Kai Uwe Broulik.
Committed on 15/11/2018 at 18:46.
Pushed by broulik into branch 'master'.

Recreate interrupted download when it is resumed

When a download is canceled, finishes, or is interrupted (e.g. loss of network connection)
we finish the KJob to remove it from notification area.

However, when a job was interrupted and is then resumed, the download ID is reused by the
browser and we only get sent updates for a job we no longer have.

When we get a change event from interrupted to in_progress just pretend a new download
was created and carry on as normal.

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

M  +15   -0    extension/extension.js

https://commits.kde.org/plasma-browser-integration/2b15d99afd539323481efdeeebd915493a0b9d40