www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 334133623245319ce998d206312d2375760b2f75
parent 41437738b0b5ae4e9a408cd0c2255d65ff36974d
Author: Dan Stillman <dstillman@zotero.org>
Date:   Mon,  6 Jul 2009 10:20:04 +0000

Fix "Sync delete log starts after last sync date in Zotero.Sync.Server.sync()" error


Diffstat:
Mchrome/content/zotero/xpcom/error.js | 1+
Mchrome/content/zotero/xpcom/sync.js | 5++++-
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/error.js b/chrome/content/zotero/xpcom/error.js @@ -11,6 +11,7 @@ Zotero.Error = function (message, error) { Zotero.Error.ERROR_UNKNOWN = 0; Zotero.Error.ERROR_MISSING_OBJECT = 1; +Zotero.Error.ERROR_FULL_SYNC_REQUIRED = 2; Zotero.Error.prototype.toString = function () { return this.message; diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js @@ -994,7 +994,9 @@ Zotero.Sync.Server = new function () { var deleted = Zotero.Sync.getDeletedObjects(lastLocalSyncDate, syncSession.uploadKeys.deleted); if (deleted == -1) { - _error('Sync delete log starts after last sync date in Zotero.Sync.Server.sync()'); + var msg = "Sync delete log starts after last sync date in Zotero.Sync.Server.sync()"; + var e = new Zotero.Error(msg, "FULL_SYNC_REQUIRED"); + throw (e); } var nextLocalSyncDate = Zotero.DB.transactionDate; @@ -1680,6 +1682,7 @@ Zotero.Sync.Server = new function () { if (e.name && e.name == 'ZOTERO_ERROR') { switch (e.error) { case Zotero.Error.ERROR_MISSING_OBJECT: + case Zotero.Error.ERROR_FULL_SYNC_REQUIRED: // Let current sync fail, and then do a full sync var background = Zotero.Sync.Runner.background; setTimeout(function () {