Bug 405968

Summary: "Sources" dropdown shows duplicate entries when you have multiple flatpak apps with the same name but a different install destination (system vs user)
Product: [Applications] Discover Reporter: Patrick Silva <bugseforuns>
Component: discoverAssignee: Dan Leinir Turthra Jensen <leinir>
Status: CONFIRMED ---    
Severity: normal CC: aleixpol, alex765, emanu.d3b, kde, nate, postix
Priority: NOR    
Version: 5.22.4   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: screenshot
discover 5.17.4
duplicated entries after flatpak bundle installation
duplicated entries after I tried to install flatpaked flameshot
Discover launched via krunner
Discover 5.21, OpenSUSE Leap 15.2, dual Flathub sources for system and user
screenshot taken on Plasma 5.22.4

Description Patrick Silva 2019-03-28 16:56:05 UTC
Created attachment 119106 [details]
screenshot

SUMMARY
I can't reproduce this bug consistently, apparently it occurs randomly.

STEPS TO REPRODUCE
1. install, via Arch repos, an app available from both Arch repos and flathub
2. restart Discover
3. search for the just installed app
4. click on the just installed app listed in the search results
5. click "Sources" dropdown

OBSERVED RESULT
As we can see in my screenshot, there are two "Installed (Arch Linux)" entries in "Sources" dropdown.

EXPECTED RESULT
only one "Installed (Arch Linux)" entry

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.15.3
KDE Frameworks Version: 5.56.0
Qt Version: 5.12.2
Comment 1 Aleix Pol 2019-12-02 18:41:40 UTC
Can you still see the issue? I'm unable to reproduce.
Can you reproduce with everything or just handbrake?
Comment 2 Patrick Silva 2019-12-03 16:28:20 UTC
Created attachment 124295 [details]
discover 5.17.4

I have just reproduced with Discover 5.17.4.
Fragments torrent client (from flathub) was already installed on my system, I searched for it in Discover, selected Arch repo in the sources dropdown and installed Fragments from it. Then I followed the steps 2-5 from comment 0 and the bug occurred. See the attached screenshot.
Comment 3 Patrick Silva 2019-12-11 09:58:52 UTC
requested info was provided.
Comment 4 Patrick Silva 2019-12-11 09:59:33 UTC
changing status.
Comment 5 Nate Graham 2019-12-11 10:40:20 UTC
*** Bug 414824 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2019-12-11 10:40:44 UTC
Seems to sometimes happen on Arch-based Manjaro too; see Bug 414824.
Comment 7 Patrick Silva 2020-06-18 15:31:32 UTC
Created attachment 129488 [details]
duplicated entries after flatpak bundle installation

This issue have just happened on neon unstable after I install a flatpak bundle locally.
I downloaded a flatpak bundle from the following link
https://gitlab.com/news-flash/news_flash_gtk

As we can see in the attached screenshot, Discover shown duplcated entries in "Sources" dropdown after the installation.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.19.80
KDE Frameworks Version: 5.72.0
Qt Version: 5.14.2
Comment 8 Aleix Pol 2020-07-30 22:56:16 UTC
After installing a bundle it makes sense that it happens, because together with the bundle we add a repository with its version of the application.

Do you still see the duplicates in other cases? this code has changed recently.
Comment 9 Nate Graham 2020-10-01 18:16:29 UTC
Can't reproduce. Can you, Patrick?
Comment 10 Patrick Silva 2020-10-01 18:34:41 UTC
Created attachment 132052 [details]
duplicated entries after I tried to install flatpaked flameshot

yes, I can.
1. Install flameshot from Arch repos
2. download flatpak version of flameshot from the following link and try to install it (Discover says that the installation is aborted due to failure)
https://github.com/flameshot-org/flameshot/releases
3. open "Sources" combobox


Operating System: Arch Linux
KDE Plasma Version: 5.19.90
KDE Frameworks Ve
Comment 11 Aleix Pol 2020-10-02 18:46:16 UTC
That's  super weird, I can't see flameshot on flathub (?).
https://flathub.org/apps/search/flameshot

It's also not listed at all for me.
Comment 12 Patrick Silva 2020-10-02 18:50:57 UTC
Open the link posted in my previous comment.
Comment 13 Patrick Silva 2020-10-15 11:36:10 UTC
new info was added in comment 12
Comment 14 Patrick Silva 2020-11-01 12:15:21 UTC
Created attachment 132936 [details]
Discover launched via krunner

it happened again on neon unstable. This time when I searched for an uninstalled
app (kubrick) with krunner and opened Discover from it. But I can't reproduce
consistently.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.20.80
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.0
Comment 15 Paul McAuley 2021-02-21 17:08:51 UTC
Created attachment 136017 [details]
Discover 5.21, OpenSUSE Leap 15.2, dual Flathub sources for system and user

I also have two Flathub sources on Discover 5.21, OpenSUSE Leap 15.2, Plasma 5.21.

The dual sources actually do different things for me. One will install the app to the system, the other will install the app for the user. I think it is useful to be able to choose whether it gets installed for the user or system, but it at least should be labelled which is which!
Comment 16 Paul McAuley 2021-02-21 17:18:20 UTC
(In reply to Paul McAuley from comment #15)
> Created attachment 136017 [details]
> Discover 5.21, OpenSUSE Leap 15.2, dual Flathub sources for system and user
> 
> I also have two Flathub sources on Discover 5.21, OpenSUSE Leap 15.2, Plasma
> 5.21.
> 
> The dual sources actually do different things for me. One will install the
> app to the system, the other will install the app for the user. I think it
> is useful to be able to choose whether it gets installed for the user or
> system, but it at least should be labelled which is which!

I think my issue is different as I am looking at Flathub, whereas here you are installing locally. I therefore created bug 433395
Comment 17 Nate Graham 2021-04-07 18:18:04 UTC
Oh this thing! We fixed it recently. Should be fixed by Plasma 5.21.4.
Comment 18 Patrick Silva 2021-08-17 22:29:14 UTC
Oh no, it happened again on Arch Linux.
Haruna player is installed, I opened Discover, searched for "haruna", clicked on the search result, clicked on "Sources" dropdown and got duplicated flathub entries as we can see in the attached screenshot.

Operating System: Arch Linux
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2
Graphics Platform: Wayland
Comment 19 Patrick Silva 2021-08-17 22:29:52 UTC
Created attachment 140805 [details]
screenshot taken on Plasma 5.22.4
Comment 20 Nate Graham 2021-08-18 15:38:22 UTC
Grr.
Comment 21 Nate Graham 2021-08-23 18:56:01 UTC
*** Bug 441422 has been marked as a duplicate of this bug. ***
Comment 22 Nate Graham 2021-08-23 18:56:15 UTC
*** Bug 441428 has been marked as a duplicate of this bug. ***
Comment 23 Aleix Pol 2021-08-31 22:20:22 UTC
Do you think it's indeed 2 separate versions or the same one duplicated?

I have not been able to reproduce :(