commit db6e9841db56375767b770dc26666df427e258aa parent d2d5896b0b0cc7d54c4eefbfc4e5334b8283c787 Author: Dan Stillman <dstillman@zotero.org> Date: Wed, 14 Jun 2017 00:41:21 -0400 Only purge orphaned WebDAV files if downloads completed successfully Diffstat:
| M | chrome/content/zotero/xpcom/storage/storageEngine.js | | | 2 | +- |
| M | chrome/content/zotero/xpcom/storage/webdav.js | | | 2 | +- |
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/storage/storageEngine.js b/chrome/content/zotero/xpcom/storage/storageEngine.js @@ -262,7 +262,7 @@ Zotero.Sync.Storage.Engine.prototype.start = Zotero.Promise.coroutine(function* } // If WebDAV sync, purge orphaned files - if (this.controller.mode == 'webdav') { + if (downloadSuccessful && this.controller.mode == 'webdav') { try { yield this.controller.purgeOrphanedStorageFiles(libraryID); } diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js @@ -1071,7 +1071,7 @@ Zotero.Sync.Storage.Mode.WebDAV.prototype = { lastModified = Zotero.Date.strToISO(lastModified); lastModified = Zotero.Date.sqlToDate(lastModified, true); - // Delete files older than a day before last sync time + // Delete files older than a week before last sync time var days = (lastSyncDate - lastModified) / 1000 / 60 / 60 / 24; if (days > daysBeforeSyncTime) {