From f2c2c9f049d50d52d312f3aaee08b8df8672e3e7 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 4 Apr 2011 17:52:28 +0000 Subject: [PATCH] Avoid conflicts with server files with maxed-out 32-bit int mod times (which I think happened for only a few days after the AWS migration) by automatically using locally modified version --- chrome/content/zotero/xpcom/storage/zfs.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js index 731a6ec877..47df56046a 100644 --- a/chrome/content/zotero/xpcom/storage/zfs.js +++ b/chrome/content/zotero/xpcom/storage/zfs.js @@ -372,11 +372,11 @@ Zotero.Sync.Storage.Session.ZFS.prototype._processUploadFile = function (data) { if (info) { // Remote mod time var mtime = info.mtime; - // Local file time var fmtime = item.attachmentModificationTime; var same = false; + var useLocal = false; if (fmtime == mtime) { same = true; Zotero.debug("File mod time matches remote file -- skipping upload"); @@ -398,6 +398,11 @@ Zotero.Sync.Storage.Session.ZFS.prototype._processUploadFile = function (data) { Zotero.debug("File mod time (" + fmtime + ") is exactly one hour off remote file (" + mtime + ") " + "-- assuming time zone issue and skipping upload"); } + // Ignore maxed-out 32-bit ints, from brief problem after switch to 32-bit servers + else if (mtime == 2147483647) { + Zotero.debug("Remote mod time is invalid -- uploading local file version"); + useLocal = true; + } if (same) { Zotero.debug(Zotero.Sync.Storage.getSyncedModificationTime(item.id)); @@ -414,7 +419,7 @@ Zotero.Sync.Storage.Session.ZFS.prototype._processUploadFile = function (data) { } var smtime = Zotero.Sync.Storage.getSyncedModificationTime(item.id); - if (smtime != mtime) { + if (!useLocal && smtime != mtime) { var localData = { modTime: fmtime }; var remoteData = { modTime: mtime }; Zotero.Sync.Storage.QueueManager.addConflict(