Bug 402928

Summary: If the update state is dirty, can't install apps (Install button on page is disabled, and clicking on the Install button on delegates triggers fetching updates)
Product: [Applications] Discover Reporter: Nate Graham <nate>
Component: discoverAssignee: Aleix Pol <aleixpol>
Status: RESOLVED FIXED    
Severity: normal CC: eric.malamisura, jarlgjessing, jr
Priority: VHI Keywords: usability
Version: 5.14.4   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=402104
https://bugs.kde.org/show_bug.cgi?id=407471
https://bugs.kde.org/show_bug.cgi?id=407641
Latest Commit: Version Fixed In: 5.18.0
Sentry Crash Report:
Attachments: pkmon log depicting me having to click twice on the install button to install KTorrent

Description Nate Graham 2019-01-06 15:42:14 UTC
A great deal of the time, when you click the "Install" button to install an app, Discover doesn't actually install the app and instead performs a check for updates. Once this has completed, only *then* will clicking on the Install button a second time actually install the app.

We should always install the app on the first click no matter what needs to happen on the backend. I'm skeptical that updates need to be fetched in the first place before you can install an app, but if this is absolutely mandatory, we should make sure updates are fetched on launch so you can install apps with no drama.
Comment 1 Nate Graham 2019-01-11 22:38:09 UTC
Created attachment 117411 [details]
pkmon log depicting me having to click twice on the install button to install KTorrent

This is trivially reproducible in Neon. Any time "Checking for updates" is displayed at the bottom of the globaldrawer, just click "Install" on any app delegate or page. Instead of installing the app, Discover completes the current update checking process. Only once this is done does the Install button actually install the app.

We should disable the "Install" buttons while Discover is checking for updates, or (very preferably) allow installing apps anyway.

I'm attaching a pkmon log that depicts what happens when I try to install KTorrent. The first click on "Install" doesn't do anything, but the second one (after Discover has finished checking for updates) works normally.
Comment 2 Aleix Pol 2019-02-25 14:39:20 UTC
This looks very much like a backend's issue, it seems like we ask to install a package and the transaction changes opinion over time.

I've been testing it on ArchLinux like you reported but haven't been able to reproduce there, can you confirm this?
Comment 3 Nate Graham 2019-02-25 14:45:27 UTC
Yeah I just trivially reproduced it on Manjaro with Plasma 5.15.1 by opening Discover and immediately clicking on the Install button for Digikam on the Featured page. The button depresses and all the other Install buttons become disabled. The drawer's status thingy on the bottom then says "Checking for updates" and the installation does not happen, and the install buttons all become re-enabled. Thereafter, clicking on any of the buttons will actually perform the installation as requested.
Comment 4 Nate Graham 2019-03-08 00:08:20 UTC
*** Bug 405020 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2019-06-06 13:08:33 UTC
*** Bug 407825 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2019-06-15 16:35:42 UTC
*** Bug 408729 has been marked as a duplicate of this bug. ***
Comment 7 Aleix Pol 2019-06-20 16:20:20 UTC
Git commit 9f56ce1543bd1234d5f0107387675bde682e00b3 by Aleix Pol.
Committed on 20/06/2019 at 16:19.
Pushed by apol into branch 'master'.

packagekit: add debug information for the attached bug

M  +14   -3    libdiscover/backends/PackageKitBackend/PKTransaction.cpp

https://commits.kde.org/discover/9f56ce1543bd1234d5f0107387675bde682e00b3
Comment 8 Nate Graham 2019-11-07 16:31:08 UTC
This was fixed recently.