From d53a7f57af449f301376bc8eaa25a1116debd7c8 Mon Sep 17 00:00:00 2001 From: Dennis van der Stelt Date: Thu, 12 Mar 2026 21:08:43 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Prevent=20isRefreshing=20from=20?= =?UTF-8?q?getting=20permanently=20stuck=20on=20fetch=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without try/finally, any exception thrown by the fetch function left isRefreshing=true forever, causing all subsequent refreshNow() calls to silently no-op — including the manual Refresh button. Also ensures firstLoad is always cleared so the spinner never shows indefinitely. --- src/Frontend/src/components/audit/AuditList.vue | 7 +++++-- src/Frontend/src/composables/autoRefresh.ts | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Frontend/src/components/audit/AuditList.vue b/src/Frontend/src/components/audit/AuditList.vue index 851c973f29..ec1645f2a8 100644 --- a/src/Frontend/src/components/audit/AuditList.vue +++ b/src/Frontend/src/components/audit/AuditList.vue @@ -63,8 +63,11 @@ onBeforeMount(() => { //without setTimeout, this happens before the store is properly initialised, and therefore the query route values aren't applied to the refresh setTimeout(async () => { - await Promise.all([refreshNow(), store.loadEndpoints()]); - firstLoad.value = false; + try { + await Promise.all([refreshNow(), store.loadEndpoints()]); + } finally { + firstLoad.value = false; + } }, 0); }); diff --git a/src/Frontend/src/composables/autoRefresh.ts b/src/Frontend/src/composables/autoRefresh.ts index 23150f3323..64b233ad29 100644 --- a/src/Frontend/src/composables/autoRefresh.ts +++ b/src/Frontend/src/composables/autoRefresh.ts @@ -11,8 +11,11 @@ export default function useFetchWithAutoRefresh(name: string, fetchFn: () => Pro return; } isRefreshing.value = true; - await fetchFn(); - isRefreshing.value = false; + try { + await fetchFn(); + } finally { + isRefreshing.value = false; + } }; const { isActive, pause, resume } = useTimeoutPoll( fetchWrapper,