From f3412dea575aed4d4c5441d8e25f3be85b8a2ca1 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 17 Apr 2026 23:53:18 -0400 Subject: [PATCH] fix(dashboard): guard failureThreshold against empty/invalid settings values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v-model.number on the Settings input returns an empty string when cleared, which persists through the PATCH and then coerces error_count >= '' to error_count >= 0 — flagging every source as failing. Coerce to Number and fall back to 5 unless the value is a finite number >= 1. Co-Authored-By: Claude Opus 4.7 --- frontend/src/views/Dashboard.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/Dashboard.vue b/frontend/src/views/Dashboard.vue index ae94e90..b610032 100644 --- a/frontend/src/views/Dashboard.vue +++ b/frontend/src/views/Dashboard.vue @@ -354,10 +354,11 @@ let refreshInterval = null const stats = computed(() => downloadsStore.stats) const recentActivity = computed(() => downloadsStore.recentActivity) -// Read threshold from settings, default 5 if unset -const failureThreshold = computed(() => - settingsStore.settings['dashboard.failure_threshold'] ?? 5 -) +// Read threshold from settings, default 5 if unset or invalid +const failureThreshold = computed(() => { + const n = Number(settingsStore.settings['dashboard.failure_threshold']) + return Number.isFinite(n) && n >= 1 ? n : 5 +}) // Per-platform health for platforms with ≥1 enabled source const platformHealth = computed(() => {