After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725020 - Each search provider shows up empty, instead of not showing
Each search provider shows up empty, instead of not showing
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: search
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2014-02-23 22:03 UTC by Elad Alfassa
Modified: 2014-03-12 18:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (1.43 MB, image/png)
2014-02-23 22:03 UTC, Elad Alfassa
  Details
search: survive the provider reporting the wrong number of metas (2.51 KB, patch)
2014-02-24 16:26 UTC, Giovanni Campagna
committed Details | Review

Description Elad Alfassa 2014-02-23 22:03:45 UTC
Created attachment 270070 [details]
screenshot

I think the design was (correct me if I'm wrong) to not show search providers if they have no results. Attached screenshot for explanation.
Comment 1 Giovanni Campagna 2014-02-23 23:21:09 UTC
That's definitely a bug. Do you see anything in the log that may hint to the cause, for example a DBus error from the search provider?
Comment 2 Elad Alfassa 2014-02-23 23:26:11 UTC
Countless of these:

Feb 24 01:14:05 weatherwax gnome-session[1196]: Gjs-Message: JS LOG: Received error from DBus search provider epiphany.desktop during GetResultMetas: Gio.DBusError: GDBus.Error:org.freedesktop.DBus.Error.Service
Feb 24 01:14:05 weatherwax gnome-session[1196]: (gnome-shell:14662): Gjs-WARNING **: JS ERROR: TypeError: this.metaInfo is undefined
Feb 24 01:14:05 weatherwax gnome-session[1196]: ListSearchResult<._init@resource:///org/gnome/shell/ui/search.js:191
Feb 24 01:14:05 weatherwax gnome-session[1196]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169
Feb 24 01:14:05 weatherwax gnome-session[1196]: _Base.prototype._construct@resource:///org/gnome/gjs/modules/lang.js:110
Feb 24 01:14:05 weatherwax gnome-session[1196]: Class.prototype._construct/newClass@resource:///org/gnome/gjs/modules/lang.js:204
Feb 24 01:14:05 weatherwax gnome-session[1196]: ListSearchResults<._createResultDisplay@resource:///org/gnome/shell/ui/search.js:431
Feb 24 01:14:05 weatherwax gnome-session[1196]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169
Feb 24 01:14:05 weatherwax gnome-session[1196]: SearchResultsBase<._ensureResultActors/</<@resource:///org/gnome/shell/ui/search.js:349
Feb 24 01:14:05 weatherwax gnome-session[1196]: SearchResultsBase<._ensureResultActors/<@resource:///org/gnome/shell/ui/search.js:347
Feb 24 01:14:05 weatherwax gnome-session[1196]: RemoteSearchProvider<._getResultMetasFinished@resource:///org/gnome/shell/ui/remoteSearch.js:251
Feb 24 01:14:05 weatherwax gnome-session[1196]: wrapper@resource:///org/gnome/gjs/modules/lang.js:169
Feb 24 01:14:05 weatherwax gnome-session[1196]: bind/<@resource:///org/gnome/gjs/modules/lang.js:95
Feb 24 01:14:05 weatherwax gnome-session[1196]: _proxyInvoker/asyncCallback@resource:///org/gnome/gjs/modules/overrides/Gio.js:86
Comment 3 Giovanni Campagna 2014-02-24 16:26:24 UTC
Created attachment 270154 [details] [review]
search: survive the provider reporting the wrong number of metas

If a provider crashes during GetResultMetas, or returns the wrong
number of metas, report it as failing but don't cause a JS exception.
Comment 4 Jasper St. Pierre (not reading bugmail) 2014-02-24 16:29:43 UTC
Review of attachment 270154 [details] [review]:

::: js/ui/search.js
@@ +348,3 @@
             this.provider.getResultMetas(metasNeeded, Lang.bind(this, function(metas) {
+                if (metas.length == 0) {
+                    callback(false);

Why this special case?
Comment 5 Giovanni Campagna 2014-02-24 16:48:14 UTC
(In reply to comment #4)
> Review of attachment 270154 [details] [review]:
> 
> ::: js/ui/search.js
> @@ +348,3 @@
>              this.provider.getResultMetas(metasNeeded, Lang.bind(this,
> function(metas) {
> +                if (metas.length == 0) {
> +                    callback(false);
> 
> Why this special case?

Because we get an empty array from RemoteSearch providers if they get a DBus error. We already logged the error in that case, so we don't need a second log.
Comment 6 Jasper St. Pierre (not reading bugmail) 2014-02-24 16:55:15 UTC
Review of attachment 270154 [details] [review]:

OK. That does mean that if the client explicitly returns 0 metas, then we'll silently fail, but OK.

(Did you file a bug with the broken search provider?)
Comment 7 Giovanni Campagna 2014-03-12 18:31:21 UTC
Attachment 270154 [details] pushed as 492558a - search: survive the provider reporting the wrong number of metas