From 8d93fd4c8cfd0e75f88d99eab88307fba5e10380 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 6 Sep 2023 07:38:14 -0400 Subject: [PATCH] Fix test breakage after f68818387 --- chrome/content/zotero/elements/mergeGroup.js | 8 +++---- .../zotero/xpcom/storage/storageLocal.js | 22 ++++++++++++++++++- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/elements/mergeGroup.js b/chrome/content/zotero/elements/mergeGroup.js index 11a4f94054..1b5432f52a 100644 --- a/chrome/content/zotero/elements/mergeGroup.js +++ b/chrome/content/zotero/elements/mergeGroup.js @@ -284,7 +284,7 @@ this.isMergePane = this.id == 'merge-pane'; if (!this.isMergePane) { - this.groupbox.onclick = this.handleClick.bind(this); + this.groupbox.onclick = this.click.bind(this); } } @@ -338,7 +338,7 @@ var button = this._class('choose-button'); button.label = Zotero.getString('sync.conflict.chooseThisVersion'); if (this.showButton) { - button.onclick = this.handleClick.bind(this); + button.onclick = this.click.bind(this); button.style.visibility = 'visible'; } else { @@ -421,7 +421,7 @@ this.groupbox.setAttribute('tabindex', 0); this.groupbox.addEventListener('keypress', (event) => { if (event.key == " ") { - this.handleClick(); + this.click(); } }); } @@ -450,7 +450,7 @@ } } - handleClick() { + click() { this.parent.choosePane(this); } diff --git a/chrome/content/zotero/xpcom/storage/storageLocal.js b/chrome/content/zotero/xpcom/storage/storageLocal.js index 7787deadc4..30a7b4b55b 100644 --- a/chrome/content/zotero/xpcom/storage/storageLocal.js +++ b/chrome/content/zotero/xpcom/storage/storageLocal.js @@ -976,7 +976,27 @@ Zotero.Sync.Storage.Local = { zipReader = null Cu.forceGC(); - zipFile.remove(false); + // TEMP: Allow deleting to fail on Windows + if (Zotero.isWin) { + try { + zipFile.remove(false); + } + catch (e) { + Zotero.logError(e); + // Try again in 30 seconds + setTimeout(() => { + try { + zipFile.remove(false); + } + catch (e) { + Zotero.logError(e); + } + }, 30000); + } + } + else { + zipFile.remove(false); + } return returnFile; }),