From 71bd1a7f99cd14152486ffd1bdcccece4522d8cd Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 5 Oct 2014 12:03:50 -0400 Subject: [PATCH] Fix state check errors (middle-pane restart messages) during syncing The state check errors were caused by 4812ab6f, which was a fix for "Q.async(...)(...) is undefined" errors caused by ad8b81f4c, which was a fix for "too much recursion" errors related to Task.spawn() on Windows with JIT enabled. --- chrome/content/zotero/xpcom/sync.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js index 185ef41ed..9ed9e9fca 100644 --- a/chrome/content/zotero/xpcom/sync.js +++ b/chrome/content/zotero/xpcom/sync.js @@ -1627,7 +1627,7 @@ Zotero.Sync.Server = new function () { _error(e); } - Q.async(Zotero.Sync.Server.Data.processUpdatedXML( + var result = Q.async(Zotero.Sync.Server.Data.processUpdatedXML( responseNode.getElementsByTagName('updated')[0], lastLocalSyncDate, syncSession, @@ -1836,13 +1836,11 @@ Zotero.Sync.Server = new function () { Zotero.HTTP.doPost(url, body, uploadCallback); } } - ))() - .then( - null, - function (e) { - errorHandler(e); - } - ); + ))(); + + if (Q.isPromise(result)) { + result.catch(errorHandler); + } } catch (e) { _error(e); @@ -2676,8 +2674,6 @@ Zotero.Sync.Server.Data = new function() { this.processUpdatedXML = function (updatedNode, lastLocalSyncDate, syncSession, defaultLibraryID, callback) { - yield true; - updatedNode.xpath = function (path) { return Zotero.Utilities.xpath(this, path); };