From cea946e745e0c143572f737042a44e0ca173b002 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Wed, 7 Jan 2015 17:53:30 +0800 Subject: [PATCH] search: don't forget to notify caller when failing to ensure actors The updateSearch() function is called in SearchResults every time new search hits are available from a search provider; SearchResults will wait for updateSearch() to complete in a callaback, to update the overall progress of the search operation. updateSearch() will call _ensureResultActors(), which will in turn call getResultMetas() on the search provider, which is an operation that can fail arbitrarily or return inconsistent data, as it's entirely in the hands of the search provider. In case _ensureResultActors() returns a failure, updateSearch() is currently failing to notify the passed-in callback, which might leave SearchResults in an inconsistent state: make sure the asynchronous flow always ends up with a notification to the updateSearch() callback. --- js/ui/search.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/ui/search.js b/js/ui/search.js index 2a8e0fd8e..d80fe6388 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -236,6 +236,7 @@ const SearchResultsBase = new Lang.Class({ this._ensureResultActors(results, Lang.bind(this, function(successful) { if (!successful) { this._clearResultDisplay(); + callback(); return; }