[gnome-shell] search: don't forget to notify caller when failing to ensure actors



commit cea946e745e0c143572f737042a44e0ca173b002
Author: Cosimo Cecchi <cosimo endlesm com>
Date:   Wed Jan 7 17:53:30 2015 +0800

    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 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/search.js b/js/ui/search.js
index 2a8e0fd..d80fe63 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;
                 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]