From a5f189ef0eec01a75e0b7855f861dc4120221850 Mon Sep 17 00:00:00 2001 From: Aaron Boodman Date: Thu, 12 Dec 2013 03:05:46 -0800 Subject: [PATCH] Fix an intermittent JavaScript error during server push. Change-Id: If942a4d79dc53619e52b205dd462d0fb8f44aeae --- server/camlistored/ui/blob_item_container.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server/camlistored/ui/blob_item_container.js b/server/camlistored/ui/blob_item_container.js index bdf944a7e..9917670a9 100644 --- a/server/camlistored/ui/blob_item_container.js +++ b/server/camlistored/ui/blob_item_container.js @@ -361,10 +361,6 @@ camlistore.BlobItemContainer.prototype.search = function(callerConstraint, this.connection_.search(JSON.stringify(query), goog.bind(this.searchDone_, this, callerConstraint, searchMode)); - - if (searchMode == this.searchMode_.NEW) { - this.startSocketQuery_(callerConstraint); - } }; camlistore.BlobItemContainer.prototype.searchDone_ = function(constraint, @@ -373,6 +369,7 @@ camlistore.BlobItemContainer.prototype.searchDone_ = function(constraint, if (searchMode == this.searchMode_.NEW) { this.resetChildren_(); this.itemCache_ = {}; + this.startSocketQuery_(constraint); } if (!result.blobs || !result.blobs.length) { @@ -631,6 +628,7 @@ function(result, startIndex) { // Remove any children we don't need anymore. var childCount = startIndex + result.blobs.length; while (this.getChildCount() > childCount) { + this.itemCache_[this.getChildAt(childCount).getBlobRef()] = null; this.removeChildAt(childCount, true); } };