Bug 434371

Summary: Uninstall widget shows wrong label progression and takes forever to finish
Product: [Frameworks and Libraries] frameworks-knewstuff Reporter: medin <med.medin.2014>
Component: generalAssignee: Dan Leinir Turthra Jensen <admin>
Severity: normal CC: justin.zobel, kde, kdelibs-bugs, nate
Priority: HI    
Version: 5.79.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.81
Attachments: Uninstall widget shows wrong label progression and takes forever to finish

Description medin 2021-03-13 20:59:57 UTC
Created attachment 136652 [details]
Uninstall widget shows wrong label progression and takes forever to finish

If I install a widget then try to remove it, the label describing the uninstall process is showing "installing" instead of "Uninstalling" and the load icon takes forever to finish and I should close the window even if load icon is still spinning. See attached video for more info.

Operating System: Manjaro Linux
KDE Plasma Version: 5.21.2
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Kernel Version: 5.4.101-1-MANJARO
OS Type: 64-bit
Comment 1 medin 2021-03-13 21:02:33 UTC
Even after closing the widgets window downloader, then reopen it again the progress icon is still spinning :)
Comment 2 Justin Zobel 2021-03-14 02:09:34 UTC
Confirmed, can reproduce on:
Operating System: Solus 4.2
KDE Plasma Version: 5.21.2
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Comment 3 Nate Graham 2021-03-15 23:09:17 UTC
Can reproduce as well.
Comment 4 Dan Leinir Turthra Jensen 2021-03-16 10:22:49 UTC
This basically is two bugs, but still, thank you for the report :)

The label being weird - there's no distinction between the various installer actions, so what it should say is "Working..." not "Installing..." (at least until we implement a system that spits out progress type messages about what the installer is doing)

The eternal spinner when you uninstall a widget is entirely unrelated to that label being wrong, though. What happens is that during uninstallation, knewstuff will attempt to delete a file, and this then causes the uninstallation to fail silently (and the end result is what you are seeing there). i'll treat this report as primarily about that issue, as it's the more critical one.

The fact that the spinner remains when you close and reopen the dialog is because once you've already opened the dialog, the data remains when you reopen it (which you can see by how it doesn't reinitialise the dialog's contents when you reopen it, it just shows what it's downloaded already). Basically, that bit's a feature, not a bug, it just happens to show that other bug ;)
Comment 5 Bug Janitor Service 2021-03-16 10:33:26 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/knewstuff/-/merge_requests/110
Comment 6 Dan Leinir Turthra Jensen 2021-03-17 15:37:34 UTC
Git commit 25797117583ea288152ddf042938cd5e1b6bfa19 by Dan Leinir Turthra Jensen.
Committed on 17/03/2021 at 15:37.
Pushed by leinir into branch 'master'.

Less risk of infinite spinner on uninstalling KPackage based things

Prior to this patch, the uninstallation function would attempt to work out if the installed item was a directory by checking for a backslash at the end of the installed files. Since we have QFileInfo, which we're already using further down in this function anyway, we might as well use the ability of that to tell us whether or not the item is a directory.

The end result is that we no longer have an infinite spinner after (successfully, as it happens) uninstalling KPackage based entries, such as Plasmoids. The symptom was most easily visible in the Plasmoid installer, which retains its engine across the entirety of a Plasma session (since the dialogue lived inside the Plasma process, and consequently never was destructed, meaning the weird state was retained).

This patch further rewords the text shown when uninstalling entries, which since it is also the text shown when installing them must be more generic. They now say some variant of "Working", to show that the entry is being worked on, which is sufficiently generic to not involve awkward formulations such as long winded "Installing or Uninstalling", or even worse "(Un)installing". At a later point in time, introducing a more full feedback system for the installation progress would be advantageous, but for a rapid fix to the immediate issue, this works.

M  +24   -0    autotests/core/installationtest.cpp
M  +14   -7    src/core/installation.cpp
M  +1    -1    src/qtquick/qml/EntryDetails.qml
M  +2    -1    src/qtquick/qml/NewStuffItem.qml
M  +1    -1    src/qtquick/qml/private/entrygriddelegates/FeedbackOverlay.qml