From e4e78d8a87f00b8434a5247773600e23b25898e4 Mon Sep 17 00:00:00 2001 From: Zaki Manian Date: Wed, 4 Mar 2026 10:05:42 -0800 Subject: [PATCH] fix(web): reset job list UI on restart failure (#499) * fix(web): reset job list UI on restart failure The restartJob() catch handler was missing a loadJobs() call, so the job row stayed in a stale highlighted state after a failed restart attempt. Add loadJobs() to match the success path behavior. Closes #485 Co-Authored-By: Claude Opus 4.6 * refactor: use .finally() for loadJobs() instead of duplicating Move loadJobs() to a .finally() block so it runs on both success and failure without duplication. Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- src/channels/web/static/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/channels/web/static/app.js b/src/channels/web/static/app.js index 7fed4157..f0878585 100644 --- a/src/channels/web/static/app.js +++ b/src/channels/web/static/app.js @@ -2427,10 +2427,12 @@ function restartJob(jobId) { apiFetch('/api/jobs/' + jobId + '/restart', { method: 'POST' }) .then((res) => { showToast('Job restarted as ' + (res.new_job_id || '').substring(0, 8), 'success'); - loadJobs(); }) .catch((err) => { showToast('Failed to restart job: ' + err.message, 'error'); + }) + .finally(() => { + loadJobs(); }); }