Bug 391126 - Regression: Discover does not list apps from Flatpak repos
Summary: Regression: Discover does not list apps from Flatpak repos
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: Flatpak Backend (show other bugs)
Version: 5.12.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-26 21:35 UTC by Patrick Silva
Modified: 2018-04-05 14:11 UTC (History)
2 users (show)

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 Patrick Silva 2018-02-26 21:35:37 UTC
When I click flathub source in "settings" discover shows "sorry, nothing found..."

Arch Linux (5.12.2) and neon dev unstable.
Comment 1 Nate Graham 2018-02-26 21:48:12 UTC
Yep, this recently regressed for me too in git master. I kept forgetting to report it, so thanks, Dr Chapatin!
Comment 2 Aleix Pol 2018-02-27 13:02:03 UTC
Git commit b38e157f3a0fb70e8b876089dca4cd9236a38465 by Aleix Pol.
Committed on 27/02/2018 at 13:01.
Pushed by apol into branch 'Plasma/5.12'.

Fix flatpak source filtering

Can't filter by display name, should filter by id.

M  +1    -1    discover/qml/SourcesPage.qml

https://commits.kde.org/discover/b38e157f3a0fb70e8b876089dca4cd9236a38465
Comment 3 Nate Graham 2018-02-28 17:00:00 UTC
Not fixed, I'm afraid. The problem remains on both the Plasma Plasma/5.12 and master branches.
Comment 4 Aleix Pol 2018-03-02 16:30:52 UTC
I cannot reproduce neither on my devel system or my neon and kubuntu systems.

Could you maybe try to dig a little bit?

This patch could help:

diff --git a/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp b/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
index 3d071e0b..30072b91 100644
--- a/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
+++ b/libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
@@ -1105,6 +1105,8 @@ ResultsStream * FlatpakBackend::search(const AbstractResourcesBackend::Filters &
     }
     auto f = [this](AbstractResource* l, AbstractResource* r) { return flatpakResourceLessThan(l,r); };
     std::sort(ret.begin(), ret.end(), f);
+
+    qWarning() << "search result" << filter << ret.size();
     return new ResultsStream(QStringLiteral("FlatpakStream"), ret);
 }
Comment 5 Nate Graham 2018-03-02 18:40:40 UTC
Huh, it actually works now with the latest commits. :/
Comment 6 Nate Graham 2018-03-06 14:31:27 UTC
Nope, broken again. And also, now the KDE apps Flatpak repo doesn't work either. Something needs to be done to make this more robust, and maybe we should an add an autotest, too.

With that line of debugging code added, here's what's printed the the console when I try to browse to Flathub and then KDEapps:

search result Filters(extends:"org.kde.discover.desktop",) 305
search result Filters(origin:"Central repository of Flatpak applications",) 305
search result Filters(origin:"KDE Applications (nightly builds)",) 305
Comment 7 Aleix Pol 2018-03-07 01:23:26 UTC
So it's listing by display (as it was before my patch) instead of sourceId...

Really weird :/
Comment 8 Aleix Pol 2018-03-16 11:31:23 UTC
Git commit b15639cbba4b285301dd0359bfbd9725165eeab1 by Aleix Pol.
Committed on 16/03/2018 at 11:12.
Pushed by apol into branch 'Plasma/5.12'.

Include a test that makes sure we can list origins

M  +8    -0    libdiscover/backends/FlatpakBackend/tests/FlatpakTest.cpp

https://commits.kde.org/discover/b15639cbba4b285301dd0359bfbd9725165eeab1
Comment 9 Aleix Pol 2018-04-05 11:01:02 UTC
Can somebody please provide some more information on how to reproduce this?
Comment 10 Nate Graham 2018-04-05 14:11:11 UTC
I'm not able to reproduce this anymore as of https://cgit.kde.org/discover.git/commit/?h=Plasma/5.12&id=e546dcc591cccf3fbc61d9344a78c63fe1b82a18