From 2d5d157fda7bd64e88e44f545db22ef1dde63f59 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 13 Jul 2008 07:31:20 +0000 Subject: [PATCH] Removed incorrect check causing "Local [object] 1 not in update array" error The remote object could legitimately not have been updated locally since the last sync if the server data was cleared and synched from a different client, potentially resulting in a different key condition on sync. The two sides should now be properly merged (at least in theory). --- chrome/content/zotero/xpcom/sync.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js index ecb81194c..69e36cabb 100644 --- a/chrome/content/zotero/xpcom/sync.js +++ b/chrome/content/zotero/xpcom/sync.js @@ -1363,12 +1363,13 @@ Zotero.Sync.Server.Data = new function() { obj.save(); // Update id in local updates array + // + // Object might not appear in local update array if server + // data was cleared and synched from another client var index = uploadIDs.updated[types].indexOf(oldID); - if (index == -1) { - throw ("Local " + type + " " + oldID + " not in " - + "update array when changing id"); + if (index != -1) { + uploadIDs.updated[types][index] = newID; } - uploadIDs.updated[types][index] = newID; // Update id in local deletions array for (var i in uploadIDs.deleted[types]) {