From e4720750874b124915d66f592b9a4b3192e11cb0 Mon Sep 17 00:00:00 2001 From: ZGaetano Date: Mon, 18 May 2026 23:46:12 -0400 Subject: [PATCH] fix(library): evict stale thumb URL on image load error, re-observe for retry When a signed S3 URL expires the img fires onerror. Previously the stale URL stayed in thumbCache so the broken image would persist. Now we delete the cache entry, clear the loaded class, and re-add the element to the IntersectionObserver so the next time it scrolls into view a fresh signed URL is fetched. --- services/web-ui/public/index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/web-ui/public/index.html b/services/web-ui/public/index.html index cad3c78..0356c08 100644 --- a/services/web-ui/public/index.html +++ b/services/web-ui/public/index.html @@ -541,7 +541,12 @@ function setImgSrc(img, src) { img.src = src; - img.onload = () => img.classList.add('loaded'); + img.onload = () => img.classList.add('loaded'); + img.onerror = () => { + delete state.thumbCache[img.dataset.assetId]; + img.classList.remove('loaded'); + thumbObserver.observe(img); + }; } // ── Init ────────────────────────────────