From 6abba43a809347b1ae4527fdc2868a1c30e24bbe Mon Sep 17 00:00:00 2001 From: Sami Date: Wed, 6 May 2026 01:58:44 -0700 Subject: [PATCH] fix(self-updater): clear all pending history entries, not just one checkPostUpdateResult() used history.find() which only ever updated a single pending entry. When multiple update attempts stacked up, the extra pending entries stayed stuck in 'pending' forever even though the actual update completed. Switch to filter() + loop to clear all matching entries. Co-Authored-By: Claude Opus 4.7 (1M context) --- dashcaddy-api/self-updater.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dashcaddy-api/self-updater.js b/dashcaddy-api/self-updater.js index a84ae8a..a2ae0a0 100644 --- a/dashcaddy-api/self-updater.js +++ b/dashcaddy-api/self-updater.js @@ -313,11 +313,13 @@ class SelfUpdater extends EventEmitter { // Update history const history = this.getUpdateHistory(); - const pending = history.find(h => h.status === 'pending'); - if (pending) { - pending.status = result.success ? 'success' : 'rolled-back'; - pending.duration = result.duration; - if (result.error) pending.error = result.error; + const updated = history.filter(h => h.status === 'pending'); + if (updated.length > 0) { + for (const pending of updated) { + pending.status = result.success ? 'success' : 'rolled-back'; + pending.duration = result.duration; + if (result.error) pending.error = result.error; + } this._saveHistory(history); }