From 8b414607c7cfa3cb2c1ebb347fd3d3377b31affa Mon Sep 17 00:00:00 2001 From: 666ghj <670939375@qq.com> Date: Wed, 22 Jul 2026 01:07:33 +0800 Subject: [PATCH] fix: prioritize failed simulation status --- frontend/src/components/Step3Simulation.vue | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/Step3Simulation.vue b/frontend/src/components/Step3Simulation.vue index 37665e42..65e3f520 100644 --- a/frontend/src/components/Step3Simulation.vue +++ b/frontend/src/components/Step3Simulation.vue @@ -519,7 +519,15 @@ const fetchRunStatus = async () => { // 通过检测 twitter_completed 和 reddit_completed 状态判断 const platformsCompleted = checkPlatformsCompleted(data) - if (isCompleted || platformsCompleted) { + // An explicit runner failure is authoritative. Platform completion flags + // can be stale or partial when one subprocess exits successfully before + // another subprocess fails, so inferred completion must not mask it. + if (isFailed) { + addLog(t('log.simFailed') + (data.error ? `: ${data.error}` : '')) + phase.value = 2 + stopPolling() + emit('update-status', 'error') + } else if (isCompleted || platformsCompleted) { if (platformsCompleted && !isCompleted) { addLog(t('log.allPlatformsCompleted')) } @@ -527,11 +535,6 @@ const fetchRunStatus = async () => { phase.value = 2 stopPolling() emit('update-status', 'completed') - } else if (isFailed) { - addLog(t('log.simFailed') + (data.error ? `: ${data.error}` : '')) - phase.value = 2 - stopPolling() - emit('update-status', 'error') } } } catch (err) { @@ -1270,4 +1273,4 @@ onUnmounted(() => { animation: spin 0.8s linear infinite; margin-right: 6px; } - \ No newline at end of file +