www

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

commit f2c2c9f049d50d52d312f3aaee08b8df8672e3e7
parent 62edf3317dda8ae971705562f6e9596c5b2868ac
Author: Dan Stillman <dstillman@zotero.org>
Date:   Mon,  4 Apr 2011 17:52:28 +0000

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


Diffstat:
Mchrome/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 @@ -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(