Bug 397531 - AppStream Krunner does not return any results if there are nonfatal errors
Summary: AppStream Krunner does not return any results if there are nonfatal errors
Status: RESOLVED FIXED
Alias: None
Product: krunner
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Kai Uwe Broulik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-16 18:11 UTC by Stefan Brüns
Modified: 2018-08-31 14:21 UTC (History)
1 user (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 Stefan Brüns 2018-08-16 18:11:32 UTC
According to 
https://www.freedesktop.org/software/appstream/docs/api/AsPool.html#as-pool-load
---
as_pool_load

Builds an index of all found components in the watched locations. The function will try to get as much data into the pool as possible, so even if the update completes with FALSE, it might still have added components to the pool.
---

The journal is filled with "no appstream for you" messages after as_pool_load returned false, and nothing is returned.

Just ignoring the return value and calling as_poll_search (via the AppStreamQt wrapper) returns correct results.
Comment 1 Nate Graham 2018-08-21 20:23:10 UTC
Wanna submit a patch? ;)
Comment 2 Stefan Brüns 2018-08-22 21:29:56 UTC
(In reply to Nate Graham from comment #1)
> Wanna submit a patch? ;)

https://phabricator.kde.org/D14807
Comment 3 Stefan Brüns 2018-08-23 19:53:42 UTC
(In reply to Stefan Brüns from comment #2)
> (In reply to Nate Graham from comment #1)
> > Wanna submit a patch? ;)
> 
> https://phabricator.kde.org/D14807

Wanna review? ;)

Btw, the validation error is caused by bad metadata created by appstream-builder, see https://github.com/hughsie/appstream-glib/issues/260
Comment 4 Nate Graham 2018-08-24 23:14:12 UTC
I wish I could, but I'm not really qualified to, I'm afraid.
Comment 5 Stefan Brüns 2018-08-31 14:21:37 UTC
Git commit 0ec3f76810b712b99f18ef5f1afa70fe4a3884fd by Stefan Brüns.
Committed on 31/08/2018 at 14:21.
Pushed by bruns into branch 'master'.

[AppStream Runner] Also search when there were errors during Pool::load

Summary:
The return code of the Pool::load() method is somewhat misleading, as it
returns true only if there were no errors at all. The error flag is set on the first
validation error, but the pool will contain meaningful data nevertheless.

Test Plan:
Searching for "blend"
Unfixed version:
No results are returned under "Software Center"
Fixed version:
Software Center: "Get Blender", "Get Hugin", ...

Reviewers: #plasma, #frameworks, apol

Reviewed By: apol

Subscribers: ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D14807

M  +0    -1    runners/appstream/appstreamrunner.cpp

https://commits.kde.org/plasma-workspace/0ec3f76810b712b99f18ef5f1afa70fe4a3884fd