GNOME Bugzilla – Bug 725020
Each search provider shows up empty, instead of not showing
Last modified: 2014-03-12 18:31:26 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.
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?
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
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.
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?
(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.
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?)
Attachment 270154 [details] pushed as 492558a - search: survive the provider reporting the wrong number of metas