www

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

commit e3e94f91eac5fa2c1202f8034ed92f2f08cbdc82
parent 2bdc6fd9f416f9d443c5514f3b1031a43b47771b
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed,  3 Apr 2013 05:50:33 -0400

Fix a few more potential file sync errors

Diffstat:
Mchrome/content/zotero/xpcom/storage.js | 7++++---
Mchrome/content/zotero/xpcom/storage/webdav.js | 4++++
Mchrome/content/zotero/xpcom/storage/zfs.js | 9++++++++-
3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js @@ -1658,7 +1658,6 @@ Zotero.Sync.Storage = new function () { if (fileList.length == 0) { Zotero.debug('No files to add -- removing zip file'); tmpFile.remove(null); - request.stop(); return false; } @@ -1670,9 +1669,10 @@ Zotero.Sync.Storage = new function () { zw.processQueue(observer, null); return true; } + // DEBUG: Do we want to catch this? catch (e) { Zotero.debug(e, 1); - request.error(e); + Components.utils.reportError(e); return false; } } @@ -1851,9 +1851,10 @@ Zotero.Sync.Storage.ZipWriterObserver.prototype = { var entry = this._zipWriter.getEntry(fileName); if (!entry) { var msg = "ZIP entry '" + fileName + "' not found for request '" + this._data.request.name + "'"; + Components.utils.reportError(msg); Zotero.debug(msg, 1); this._zipWriter.close(); - this._data.request.error(msg); + this._callback(false); return; } originalSize += entry.realSize; diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js @@ -960,6 +960,10 @@ Zotero.Sync.Storage.WebDAV = (function () { var created = Zotero.Sync.Storage.createUploadFile( request, function (data) { + if (!data) { + deferred.resolve(false); + return; + } deferred.resolve( Q.fcall(function () { return processUploadFile(data); diff --git a/chrome/content/zotero/xpcom/storage/zfs.js b/chrome/content/zotero/xpcom/storage/zfs.js @@ -873,12 +873,19 @@ Zotero.Sync.Storage.ZFS = (function () { var item = Zotero.Sync.Storage.getItemFromRequestName(request.name); if (Zotero.Attachments.getNumFiles(item) > 1) { var deferred = Q.defer(); - Zotero.Sync.Storage.createUploadFile( + var created = Zotero.Sync.Storage.createUploadFile( request, function (data) { + if (!data) { + deferred.resolve(false); + return; + } deferred.resolve(processUploadFile(data)); } ); + if (!created) { + return Q(false); + } return deferred.promise; } else {