commit 1100015d2c0e5647f09e40d86df27c429f8e5471
parent 69c27cd8a7dd0dda989ee3aecc3fd76a11841fe4
Author: Dan Stillman <dstillman@zotero.org>
Date: Fri, 1 Sep 2017 17:46:20 -0400
Don't purge data tables until after schema update
It's no longer necessary to do this before syncing, since tags and
creators aren't first-class objects.
Diffstat:
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js
@@ -848,6 +848,8 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
Zotero.Feeds.init();
Zotero.addShutdownListener(() => Zotero.Feeds.uninit());
+ Zotero.Schema.schemaUpdatePromise.then(Zotero.purgeDataObjects.bind(Zotero));
+
return true;
}
catch (e) {
@@ -1987,6 +1989,8 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
* Clear entries that no longer exist from various tables
*/
this.purgeDataObjects = Zotero.Promise.coroutine(function* () {
+ var d = new Date();
+
yield Zotero.DB.executeTransaction(function* () {
return Zotero.Creators.purge();
});
@@ -2001,6 +2005,8 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
//yield Zotero.DB.executeTransaction(function* () {
// return Zotero.Relations.purge();
//});
+
+ Zotero.debug("Purged data tables in " + (new Date() - d) + " ms");
});
diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js
@@ -414,11 +414,6 @@ var ZoteroPane = new function()
searchBar.inputField.select();
}, 1);
- var d = new Date();
- yield Zotero.purgeDataObjects();
- var d2 = new Date();
- Zotero.debug("Purged data tables in " + (d2 - d) + " ms");
-
// Auto-sync on pane open or if new account
if (Zotero.Prefs.get('sync.autoSync') || Zotero.initAutoSync) {
yield Zotero.proxyAuthComplete;