Bug 461664 - Discover should auto-select the source for installed apps
Summary: Discover should auto-select the source for installed apps
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: discover (show other bugs)
Version: 5.26.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2022-11-10 13:11 UTC by shatz.dan
Modified: 2022-11-29 00:24 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.26.4


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description shatz.dan 2022-11-10 13:11:45 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Kickoff - right click an app -> uninstall
2. Discover opens the app page. 

OBSERVED RESULT
3a. Package manager source is preselected. App appears as not installed.
Switching source to flatpak makes the app un-installable.

EXPECTED RESULT
3b. The source from which the app is installed is automatically selected (flatpak in my case). App should then be shown as installed and uninstall button should be visible.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Opensuse tumbleweed 20221107
KDE Plasma Version: 5.26.3
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.7

ADDITIONAL INFORMATION
App I used to test this: Digikam
Comment 1 Nate Graham 2022-11-10 17:05:00 UTC
This is working for me.

Can you do the following:
1. find the app's appstream:// URL by searching for it using `appstreamcli search`
2. Once you have the app's AppStream URL, open it in Discover in a terminal window, like so: `plasma-discover appstreamcli://[the id]`

And see if it opens from the correct source to allow you to uninstall it immediately.
Comment 2 shatz.dan 2022-11-10 18:24:29 UTC
I tried the steps and it works as expected.
Also can't reproduce the original issue anymore. I guess it was a random glitch?
Comment 3 Nate Graham 2022-11-10 18:51:24 UTC
Sounds like it.
Comment 4 Aleix Pol 2022-11-11 18:11:11 UTC
Created a patch because the problem is theoretically possible and easy to fix in a generic way:
https://invent.kde.org/plasma/discover/-/merge_requests/413
Comment 5 Nate Graham 2022-11-28 15:45:13 UTC
Git commit 706ebd9a87bbf9cdef090df97e28d38ea501bb54 by Nate Graham, on behalf of Aleix Pol.
Committed on 28/11/2022 at 15:43.
Pushed by ngraham into branch 'master'.

Prefer openining the installed version of an app

When opening discover with a specific app as a command line argument and
this application has several versions, prefer showing the one that is
installed.

Since the app state might be delayed, we need to monitor the state of
the packages that don't know it for a bit. Delaying the initial state is
something we do commonly on the PackageKit backend.

M  +35   -1    discover/DiscoverObject.cpp

https://invent.kde.org/plasma/discover/commit/706ebd9a87bbf9cdef090df97e28d38ea501bb54
Comment 6 Nate Graham 2022-11-28 15:55:45 UTC
Git commit 4549356075552941b64ba0d1066f325a55801688 by Nate Graham, on behalf of Aleix Pol.
Committed on 28/11/2022 at 15:55.
Pushed by ngraham into branch 'cherry-pick-706ebd9a'.

Prefer openining the installed version of an app

When opening discover with a specific app as a command line argument and
this application has several versions, prefer showing the one that is
installed.

Since the app state might be delayed, we need to monitor the state of
the packages that don't know it for a bit. Delaying the initial state is
something we do commonly on the PackageKit backend.


(cherry picked from commit 706ebd9a87bbf9cdef090df97e28d38ea501bb54)

M  +35   -1    discover/DiscoverObject.cpp

https://invent.kde.org/plasma/discover/commit/4549356075552941b64ba0d1066f325a55801688