Bug 436333 - Opening Discover with a .flatpakref file for an already-installed app causes an error
Summary: Opening Discover with a .flatpakref file for an already-installed app causes ...
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: Flatpak Backend (show other bugs)
Version: 5.21.4
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: Dan Leinir Turthra Jensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-29 01:57 UTC by Felipe Kinoshita
Modified: 2021-05-05 16:15 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.22


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felipe Kinoshita 2021-04-29 01:57:57 UTC
When opening a .flatpakref file and Discover is not open causes an error.

STEPS TO REPRODUCE
1. grab a .flatpakref file (e.g com.spotify.Client.flatpakref from flathub)
2. with discover closed, double click the .flatpakref file

OBSERVED RESULT
Discover launches with an error: "Could not open file:///path/to/flatpakref.

EXPECTED RESULT
Discover should open .flatpakref files correctly.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Tumbleweed
(available in About System)
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.81.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
It does work if you double click the .flatpakref while Discover is open.
Comment 1 Aleix Pol 2021-04-30 01:37:50 UTC
I can reproduce it for applications I already have installed. Can you confirm that you have the same problem?
Comment 2 Felipe Kinoshita 2021-04-30 02:28:05 UTC
Yes, this only occurs with already installed flatpaks.
Comment 3 Aleix Pol 2021-05-05 02:26:53 UTC
Git commit d8d568b86f809a558dc5215a04e6781e797ba62e by Aleix Pol.
Committed on 05/05/2021 at 02:24.
Pushed by apol into branch 'master'.

flatpak: Use async API to search for already installed flatpakrefs

libflatpak will refuse to give us a ref if it's already installed, so we
want to rely on the installed db. At startup it might not be loaded yet,
so let's just call a function that will do the right thing at the right
time.

M  +5    -3    libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp

https://invent.kde.org/plasma/discover/commit/d8d568b86f809a558dc5215a04e6781e797ba62e