From daf945d8b17adb853fc56e28c7417a2724cd7995 Mon Sep 17 00:00:00 2001 From: Jeremy Walker Date: Mon, 9 Feb 2026 11:03:58 +0000 Subject: [PATCH] Handle network errors in useSubmissionsList test run fetch When fetching test run data fails due to a transient network error (TypeError: Failed to fetch), remove the submission from the list to reset the UI to a clean state instead of leaving it stuck. Closes #8465 Closes #8467 Co-Authored-By: Claude Opus 4.6 --- .../components/editor/useSubmissionsList.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/javascript/components/editor/useSubmissionsList.ts b/app/javascript/components/editor/useSubmissionsList.ts index 05d6f60754..391cb01439 100644 --- a/app/javascript/components/editor/useSubmissionsList.ts +++ b/app/javascript/components/editor/useSubmissionsList.ts @@ -154,11 +154,15 @@ export const useSubmissionsList = ( method: 'GET', }) - fetch.then((json) => { - const testRun = typecheck(json, 'testRun') + fetch + .then((json) => { + const testRun = typecheck(json, 'testRun') - set(current.uuid, { ...current, testRun: testRun }) - }) + set(current.uuid, { ...current, testRun: testRun }) + }) + .catch(() => { + remove(current.uuid) + }) }, [set]) return { current, create, set, remove }