diff --git a/chrome/content/zotero/xpcom/data/dataObjects.js b/chrome/content/zotero/xpcom/data/dataObjects.js index 73c9963d6..398dd1a9c 100644 --- a/chrome/content/zotero/xpcom/data/dataObjects.js +++ b/chrome/content/zotero/xpcom/data/dataObjects.js @@ -147,7 +147,7 @@ Zotero.DataObjects = function (object, objectPlural, id, table) { } - this.getNewer = function (date) { + this.getNewer = function (date, ignoreFutureDates) { if (date && date.constructor.name != 'Date') { throw ("date must be a JS Date in " + "Zotero." + this._ZDO_Objects + ".getNewer()") @@ -156,6 +156,9 @@ Zotero.DataObjects = function (object, objectPlural, id, table) { var sql = "SELECT ROWID FROM " + this._ZDO_table; if (date) { sql += " WHERE clientDateModified>?"; + if (ignoreFutureDates) { + sql += " AND clientDateModified<=CURRENT_TIMESTAMP"; + } return Zotero.DB.columnQuery(sql, Zotero.Date.dateToSQL(date, true)); } return Zotero.DB.columnQuery(sql); diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js index 339561fbb..83eb0073d 100644 --- a/chrome/content/zotero/xpcom/sync.js +++ b/chrome/content/zotero/xpcom/sync.js @@ -1532,7 +1532,7 @@ Zotero.Sync.Server = new function () { // Check if any items were modified during /upload, // and restart the sync if so - if (Zotero.Items.getNewer(nextLocalSyncDate)) { + if (Zotero.Items.getNewer(nextLocalSyncDate, true)) { Zotero.debug("Items were modified during upload -- restarting sync"); Zotero.Sync.Server.sync(_callbacks, true, true); return;