From db6e9841db56375767b770dc26666df427e258aa Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 14 Jun 2017 00:41:21 -0400 Subject: [PATCH] Only purge orphaned WebDAV files if downloads completed successfully --- chrome/content/zotero/xpcom/storage/storageEngine.js | 2 +- 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 index 1b31e00f0..303ecb369 100644 --- 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 index b6953d14c..a7f0381c4 100644 --- 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) {