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).
This commit is contained in:
Dan Stillman 2008-07-13 07:31:20 +00:00
parent e4f49588c0
commit 51edc5ad16

View file

@ -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]) {