commit a70a517f7ef68f262cb0a9b746d78de76d7f799f
parent da387874a2bc5b7639b12286e8f9af8b7e9a6782
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 27 Nov 2017 17:29:14 -0500
Don't start transaction to clear search temp table
This might fix loss of item focus when editing a note in a search,
possibly starting with fbf2fbe0c6.
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js
@@ -2359,11 +2359,12 @@ Zotero.CollectionTreeCache = {
"clear": function () {
this.lastTreeRow = null;
this.lastSearch = null;
- if(this.lastTempTable) {
- // Drop the last temp table when we can. We don't wait on this because it can cause a
- // deadlock: this waits on open transactions, but a transaction could be waiting on
- // ItemTreeView::notify(), which waits on ItemTreeView::refresh(), which calls this.
- Zotero.DB.queryTx("DROP TABLE IF EXISTS " + this.lastTempTable).done();
+ if (this.lastTempTable) {
+ let tableName = this.lastTempTable;
+ let id = Zotero.DB.addCallback('commit', async function () {
+ await Zotero.DB.queryAsync("DROP TABLE IF EXISTS " + tableName);
+ Zotero.DB.removeCallback('commit', id);
+ });
}
this.lastTempTable = null;
this.lastResults = null;