commit 69e5c5ae05297d434c37e66a6304cbe7e9c668ba
parent ae277391b63a16989635af7f3bf1b036e84d7aa3
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 12 Nov 2015 02:49:36 -0500
Don't accept libraryVersion in syncAPIClient::getVersions()
Since /settings is always called first with If-Modified-Since-Version,
it's never necessary to include that in the versions request.
Diffstat:
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/chrome/content/zotero/xpcom/sync/syncAPIClient.js b/chrome/content/zotero/xpcom/sync/syncAPIClient.js
@@ -158,9 +158,10 @@ Zotero.Sync.APIClient.prototype = {
* @param {Integer} libraryTypeID userID or groupID
* @param {String} objectType 'item', 'collection', 'search'
* @param {Object} queryParams Query parameters (see buildRequestURI())
- * @return {Promise<Object>|FALSE} Object with 'libraryVersion' and 'results'
+ * @return {Promise<Object>|false} - Object with 'libraryVersion' and 'results', or false if
+ * nothing changed since specified library version
*/
- getVersions: Zotero.Promise.coroutine(function* (libraryType, libraryTypeID, objectType, queryParams, libraryVersion) {
+ getVersions: Zotero.Promise.coroutine(function* (libraryType, libraryTypeID, objectType, queryParams) {
var objectTypePlural = Zotero.DataObjectUtilities.getObjectTypePlural(objectType);
var params = {
@@ -184,11 +185,6 @@ Zotero.Sync.APIClient.prototype = {
var options = {
successCodes: [200, 304]
};
- if (libraryVersion) {
- options.headers = {
- "If-Modified-Since-Version": libraryVersion
- };
- }
var xmlhttp = yield this.makeRequest("GET", uri, options);
if (xmlhttp.status == 304) {
return false;