Bug 401038 - New notification not created when a failed download is resumed
Summary: New notification not created when a failed download is resumed
Status: RESOLVED FIXED
Alias: None
Product: plasma-browser-integration
Classification: Plasma
Component: Chrome (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Kai Uwe Broulik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-14 16:44 UTC by Sipho Mateke
Modified: 2018-11-15 18:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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