Bug 478340 - Cannot set priority of multiple flatpak repos that have the same name
Summary: Cannot set priority of multiple flatpak repos that have the same name
Status: CONFIRMED
Alias: None
Product: Discover
Classification: Applications
Component: Flatpak Backend (show other bugs)
Version: 5.27.9
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
: 490678 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-12-10 08:29 UTC by Larina Loriasel
Modified: 2024-07-23 11:36 UTC (History)
5 users (show)

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


Attachments
The arrows to set the priority are greyed out (53.61 KB, image/png)
2023-12-10 08:29 UTC, Larina Loriasel
Details
The sorting section after readding the system flathub repo under a different name as flathub-system (21.04 KB, image/png)
2023-12-18 13:18 UTC, Larina Loriasel
Details
Current result of flatpak remotes (keep in mind previous both were named flathub) (4.07 KB, image/png)
2023-12-18 13:19 UTC, Larina Loriasel
Details
Flatpak Priority (18.16 KB, image/png)
2023-12-23 09:45 UTC, Larina Loriasel
Details
App I have never installed or viewed (31.10 KB, image/png)
2023-12-23 09:46 UTC, Larina Loriasel
Details
Previous app (38.30 KB, image/png)
2023-12-23 09:47 UTC, Larina Loriasel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Larina Loriasel 2023-12-10 08:29:08 UTC
Created attachment 164061 [details]
The arrows to set the priority are greyed out

SUMMARY
I cannot set the priority of my Flatpak repos in Discover

STEPS TO REPRODUCE
1. Add the same repo with the same name via the flatpak CLI tool
2. Start Discover
3. The priority setting for Discover is broken

OBSERVED RESULT
Cannot set priority

EXPECTED RESULT
Can set priority

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  Fedora Kinoite 39 
(available in About System)
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11

ADDITIONAL INFORMATION
This is the output of ```flatpak remotes``` on my system.

Name    Options
flathub system
flathub user

I previously named the system repo as flathub-system and the user repo as flathub, priority setting worked fine in that case.
But after removing all flatpak remotes and adding both the system and user with the same name (flathub), the priority setting became broken.
Comment 1 Nate Graham 2023-12-12 17:38:23 UTC
They're enabled for me on Fedora KDE (non-Kinoite). I wonder if Kinoite having an immutable base system is causing this.
Comment 2 Larina Loriasel 2023-12-18 13:17:13 UTC
(In reply to Nate Graham from comment #1)
> They're enabled for me on Fedora KDE (non-Kinoite). I wonder if Kinoite
> having an immutable base system is causing this.

I recently removed the system flathub repo and readded it with the name "flathub-system"
now the sorting arrows appear
Comment 3 Larina Loriasel 2023-12-18 13:18:20 UTC
Created attachment 164272 [details]
The sorting section after readding the system flathub repo under a different name as flathub-system
Comment 4 Larina Loriasel 2023-12-18 13:19:05 UTC
Created attachment 164273 [details]
Current result of flatpak remotes (keep in mind previous both were named flathub)
Comment 5 Larina Loriasel 2023-12-18 13:23:32 UTC
So it appears that...

1. If two flatpak repos share the same name, Discover greys out the sorting arrows
2. It specifically happens if one of the repo is a system repo, while the other one is a user repo
3. Removing, then readding back either the user or the system repo under a different name solves the issue

4. To reproduce, make sure you have no flatpak repos in your system, then run
`    flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo ` (adds the flathub repo as a system repo with the name "flathub")
`    flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo ` (adds the flathub repo as a user repo with the name "flathub")

5. To observe that otherwise sorting works fine, remove all flatpak repos, then run
`    flatpak remote-add --if-not-exists flathub-system https://dl.flathub.org/repo/flathub.flatpakrepo ` (adds the flathub repo as a system repo with the name "flathub-system")
`    flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo ` (adds the flathub repo as a user repo with the name "flathub")
Comment 6 Nate Graham 2023-12-20 20:17:32 UTC
Fascinating. Excellent investigation; I can reproduce that.
Comment 7 Larina Loriasel 2023-12-23 09:39:07 UTC
I would also like to add that Discover does not "Honor" my Flatpak repo priority even though I have it set correctly in the settings.
Might or might not be related to this issue.
Might also be that Discover is remembering the last used repo in the "Sources" in an App's info page, which might be confusing to users.
Comment 8 Larina Loriasel 2023-12-23 09:44:28 UTC
(In reply to Larina Loriasel from comment #7)
> I would also like to add that Discover does not "Honor" my Flatpak repo
> priority even though I have it set correctly in the settings.
> Might or might not be related to this issue.
> Might also be that Discover is remembering the last used repo in the
> "Sources" in an App's info page, which might be confusing to users.

I have rechecked, it appears that older apps I mistakenly downloaded from Flathub system repo, defaults to Flathub system repo in the "Sources" submenu instead of my user's Flathub repo that i set to have the highest priority
While "new" apps which i have never downloaded or manually set the repo for in the "Sources" tab respect my flatpak priority
Comment 9 Larina Loriasel 2023-12-23 09:45:08 UTC
Created attachment 164395 [details]
Flatpak Priority

My current flatpak priority
Comment 10 Larina Loriasel 2023-12-23 09:46:05 UTC
Created attachment 164396 [details]
App I have never installed or viewed

I have never installed or viewed this app/app's page in discover, respects my flatpak priority
Comment 11 Larina Loriasel 2023-12-23 09:47:14 UTC
Created attachment 164397 [details]
Previous app

I have previously installed/viewed this app/app's page on Discover, it does not respect my flatpak priority
Probably "remembers" the last selected source, which can be confusing
Comment 12 Harald Sitter 2024-07-23 11:36:32 UTC
*** Bug 490678 has been marked as a duplicate of this bug. ***