Bug 402093

Summary: Duplicated apps in Installed and Repository lists
Product: [Applications] Discover Reporter: Andrey <butirsky>
Component: Flatpak BackendAssignee: Aleix Pol <aleixpol>
Status: RESOLVED DUPLICATE    
Severity: normal CC: jgrulich, nate, peter.eszlari
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: duplicated "Another World" app in the repo
duplicated app in the Installed list

Description Andrey 2018-12-13 14:00:19 UTC
Created attachment 116893 [details]
duplicated "Another World" app in the repo

Installed Flatpak apps can be duplicated in Installed and Repository lists.

Following conditions seems have to be met for the problem to show up:
- the app must be exported to some local repo
- the app must be installed (from the local repo or directly from build-dir, doesn't matter)
- the app must contain AppData xml
- the AppStream must be exported to the repo from app's build-dir, and then updated to flatpak itself:
$ flatpak build-export --update-appstream repo build-dir
$ flatpak update --appstream

Seems related to https://bugs.kde.org/show_bug.cgi?id=393110
Comment 1 Andrey 2018-12-13 14:02:25 UTC
Created attachment 116894 [details]
duplicated app in the Installed list
Comment 2 Aleix Pol 2018-12-13 14:09:19 UTC
Can you provide the commands you follow to create the repository? It will help to reproduce locally and work into the fix.
Comment 3 Andrey 2018-12-13 14:12:52 UTC
Aleix, it's just as simple as this:
$ flatpak-builder --force-clean --user --repo=repo  build-dir org.flatpak.Hello.json

You can use random manifest here. Just make sure you have installed the same app
Comment 4 Andrey 2018-12-13 14:14:14 UTC
To add the repo:
$ flatpak remote-add --no-gpg-verify --user test repo
Comment 5 Andrey 2018-12-13 14:16:41 UTC
Important note:
the App ID should not be present in any other repositories than local repo!
Comment 6 Andrey 2018-12-27 20:30:37 UTC
Nate, it would be fine if you try to reproduce this.
I can't check non-flatpak version
Comment 7 Peter Eszlari 2020-04-23 13:00:21 UTC
I found to causes for duplicated entries:

1. appdata.xml is split from the main package

example: kdenlive in Ubuntu
/usr/share/applications/org.kde.kdenlive.desktop in package "kdenlive"
/usr/share/metainfo/org.kde.kdenlive.appdata.xml in package "kdenlive-data"

2. distribution package doesn't ship a appdata.xml file

example: blender, dolphin-emu
Comment 8 Peter Eszlari 2020-04-23 13:04:03 UTC
Of course, the third should be well known:

3. The <id> tag in the appdata.xml files don't match and <provides> is not used.
Comment 9 Nate Graham 2020-04-23 14:09:31 UTC
Yes.

These are problems caused by the packaging and unfortunately not something Discover can fix. We can make the duplicated display look less duplicatey though. Marking as a duplicate of that

*** This bug has been marked as a duplicate of bug 399530 ***