From 9e45191b22dc84753c0733961fd273612e2ea08d Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 21 Aug 2026 16:06:36 -0400 Subject: [PATCH] Stop observing idle after the database is closed permanently A permanently closed connection kept its idle observer, so it went on being notified and attempting backups for the life of the process. This affects plugin databases, which are closed permanently when the plugin shuts down. --- chrome/content/zotero/xpcom/db.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js index 9d38793bf7..09abc03303 100644 --- a/chrome/content/zotero/xpcom/db.js +++ b/chrome/content/zotero/xpcom/db.js @@ -1232,6 +1232,13 @@ Zotero.DBConnection.prototype.closeDatabase = async function (permanent) { this._connection = permanent ? false : null; Zotero.debug("Database closed"); } + + if (permanent && this._idleObserverRegistered) { + this._idleObserverRegistered = false; + Components.classes["@mozilla.org/widget/useridleservice;1"] + .getService(Components.interfaces.nsIUserIdleService) + .removeIdleObserver(this, this.IDLE_OBSERVER_SECONDS); + } };