Bug 389186 - When an app is available from two Flatpak repos and a PackageKit repo, switching its source to a Flatpak repo makes the PackageKit repo temporarily disappear
Summary: When an app is available from two Flatpak repos and a PackageKit repo, switch...
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Unclassified
Component: discover (show other bugs)
Version: unspecified
Platform: Neon Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-19 03:08 UTC by Nate Graham
Modified: 2018-01-25 14:05 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2018-01-19 03:08:40 UTC
[Discover with PackageKit, Snap, and Flatpak backends compiled from source on KDE Neon]


I found this bug while I was working on my patch to use a Combobox for the source chooser, because it's much more obvious with UI, but the bug is already present today even without it. Here's how to reproduce it:
1. Make the PackageKit backend your default backend
2. Add Flathub repo
3. Add GNOME nightly runtime repo (https://sdk.gnome.org/nightly/repo)
4. Add GNOME nightly apps repo (https://sdk.gnome.org/nightly/repo-apps)
5. Navigate to Polari
6. Click on the Link text to bring up the source chooser UI
7. Click on one of the Flatpak options


Results:
- After changing the source, the PackageKit version disappears and is no longer available if you try to switch back to it


Reproducibility:
Seems to affect all apps available from multiple Flatpak repos as well as a distro repo. With the above set-up, I can reproduce this with the following apps, since they follow that pattern on my system:
- Polari
- GNOME Calendar
- GNOME Books
- GNOME Todo
- GNOME DOcuments
- ...Even more; I stopped here after establising the pattern

If you go back and navigate to the app again, the PackageKit version has re-appeared, and will stay avialable until you switch the source again.
Comment 1 Nate Graham 2018-01-19 03:29:11 UTC
However, Gedit breaks the pattern: I have it available from the same distro repo and same two Flatpak repos, and the bug does not occur for it. One difference from the others that I notice is that Gedit doesn't have version numbers for its Flatpak versions; the other apps do.
Comment 2 Aleix Pol 2018-01-25 12:54:37 UTC
Git commit 759fbf2c6d5183d6a06d467bdff95826b1312382 by Aleix Pol.
Committed on 25/01/2018 at 12:49.
Pushed by apol into branch 'Plasma/5.12'.

QUrl will make the host lowercase and mess with the hash look-up

This should work for now, could consider a more holistic approach some
day.

M  +10   -3    libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp

https://commits.kde.org/discover/759fbf2c6d5183d6a06d467bdff95826b1312382
Comment 3 Nate Graham 2018-01-25 14:05:14 UTC
Confirming the fix, thanks!