From 178719e443977c809531a5e019115229f03d8f8c Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Tue, 21 Apr 2026 18:47:15 -0700 Subject: [PATCH] Fix metadata cache health bar duplicating on findings dashboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _loadCacheHealthStats ran async from loadRepairFindingsDashboard and appended a new .repair-cache-health div each time. If the dashboard refreshed while earlier fetches were still in flight, each resolving fetch appended its own section — producing 2–6 stacked copies. Now each fetch removes any existing .repair-cache-health inside the dashboard before appending, so at most one bar is ever visible. --- webui/static/helper.js | 1 + webui/static/script.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/webui/static/helper.js b/webui/static/helper.js index be2a628d..9f6ef9ad 100644 --- a/webui/static/helper.js +++ b/webui/static/helper.js @@ -3602,6 +3602,7 @@ const WHATS_NEW = { '2.36': [ // --- April 21, 2026 --- { date: 'April 21, 2026' }, + { title: 'Fix Metadata Cache Bar Duplicating on Findings Dashboard', desc: 'The "Metadata Cache · View Details" bar under the findings chips could stack into 2–6 copies if the dashboard refreshed while a cache-health fetch was still in flight. Each resolved fetch appended its own section. Now each fetch clears any existing bar before appending', page: 'library' }, { title: 'Fix Discography Backfill Stalling When Repair Worker Paused', desc: 'Force-running a job via "Run Now" stalled forever when the master repair worker was paused. The job entered the scan function, logged its starting banner, then blocked on the first wait_if_paused check. Force-run now bypasses the master-pause — scheduled runs still respect it', page: 'library' }, { title: 'Discography Backfill: 3-Option Fix Dialog', desc: 'Clicking Fix on a missing-track finding now prompts "Add to Wishlist", "Just Clear Finding", or "Cancel" instead of silently adding to wishlist. Bulk Fix shows the same prompt once for all selected backfill findings', page: 'library' }, { title: 'Discography Backfill: Auto-Add to Wishlist Setting', desc: 'New opt-in setting in the Discography Backfill job config. When enabled, missing tracks are pushed straight to the wishlist during the scan AND a finding is created for the log. Default is off — you review and click Fix', page: 'library' }, diff --git a/webui/static/script.js b/webui/static/script.js index b5f40347..fce577a5 100644 --- a/webui/static/script.js +++ b/webui/static/script.js @@ -65523,6 +65523,11 @@ async function _loadCacheHealthStats(dashboard) { const healthScore = stats.junk_entities === 0 && stats.stale_mb_nulls === 0 ? 'healthy' : stats.junk_entities > 50 ? 'poor' : 'fair'; const healthLabel = healthScore === 'healthy' ? 'Healthy' : healthScore === 'fair' ? 'Needs Cleanup' : 'Needs Attention'; + // Remove any existing cache-health bar before appending — prevents + // stacking when multiple dashboard refreshes race and each resolved + // fetch appends its own section. + dashboard.querySelectorAll('.repair-cache-health').forEach(el => el.remove()); + const section = document.createElement('div'); section.className = 'repair-cache-health'; section.innerHTML = `