From b72b773d87d5a6209593fcc16e948d5e39a30f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 30 Aug 2018 07:11:24 +0200 Subject: [PATCH] search: Ignore search provider results metas if search is cancelled When a search has been cancelled, it is expected that providers don't return the requested number of results, so don't log a warning in that case. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/205 --- js/ui/search.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/ui/search.js b/js/ui/search.js index 804be9593..396674107 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -226,6 +226,12 @@ var SearchResultsBase = new Lang.Class({ this._cancellable.reset(); this.provider.getResultMetas(metasNeeded, metas => { + if (this._cancellable.is_cancelled()) { + if (metas.length > 0) + log(`Search provider ${this.provider.id} returned results after the request was canceled`); + callback(false); + return; + } if (metas.length != metasNeeded.length) { log('Wrong number of result metas returned by search provider ' + this.provider.id + ': expected ' + metasNeeded.length + ' but got ' + metas.length);