fix: prioritize failed simulation status

This commit is contained in:
666ghj 2026-07-22 01:07:33 +08:00
parent 867b54cb81
commit 8b414607c7
1 changed files with 10 additions and 7 deletions

View File

@ -519,7 +519,15 @@ const fetchRunStatus = async () => {
// twitter_completed reddit_completed // twitter_completed reddit_completed
const platformsCompleted = checkPlatformsCompleted(data) 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) { if (platformsCompleted && !isCompleted) {
addLog(t('log.allPlatformsCompleted')) addLog(t('log.allPlatformsCompleted'))
} }
@ -527,11 +535,6 @@ const fetchRunStatus = async () => {
phase.value = 2 phase.value = 2
stopPolling() stopPolling()
emit('update-status', 'completed') 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) { } catch (err) {