From 0f7532d1f3d1d388a8e5f2f30db77f8d6c31d367 Mon Sep 17 00:00:00 2001 From: Jeffrey Smith Date: Thu, 2 Apr 2026 22:25:25 +0000 Subject: [PATCH] Fix advance response status check for stage progression The advance API returns instance status ("active"/"completed") but the template JS checked for "advanced" which was never returned. On successful advance while instance is still active, reload the page to render the next stage. Co-Authored-By: Claude Opus 4.6 (1M context) --- server/pages/templates/workflow.html | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/server/pages/templates/workflow.html b/server/pages/templates/workflow.html index d4e5108..68a1767 100644 --- a/server/pages/templates/workflow.html +++ b/server/pages/templates/workflow.html @@ -452,16 +452,13 @@ return; } - // Success - if (result.status === 'advanced' || result.status === 'completed') { - showFormSuccess(result.status === 'completed' - ? 'Thank you! Your submission is complete.' - : 'Submitted! Moving to the next step...'); - if (result.status === 'advanced') { - setTimeout(function() { window.location.reload(); }, 1500); - } + // Success — API returns instance status: "active" (advanced) or "completed" + if (result.status === 'completed') { + showFormSuccess('Thank you! Your submission is complete.'); } else { - showFormSuccess('Your response has been submitted.'); + // Still active = advanced to next stage — reload to render it + showFormSuccess('Submitted! Moving to the next step...'); + setTimeout(function() { window.location.reload(); }, 1500); } } catch(e) { alert('Network error: ' + e.message);