Merge pull request #732: prioritize terminal simulation failure

Stop polling on explicit runner failure even when platform counters could imply completion.
This commit is contained in:
BaiFu 2026-07-22 19:45:17 +08:00 committed by GitHub
commit e16456575e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 2 deletions

View File

@ -513,12 +513,21 @@ const fetchRunStatus = async () => {
// runner_status
const isCompleted = data.runner_status === 'completed' || data.runner_status === 'stopped'
const isFailed = data.runner_status === 'failed'
// runner_status
// 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'))
}
@ -1264,4 +1273,4 @@ onUnmounted(() => {
animation: spin 0.8s linear infinite;
margin-right: 6px;
}
</style>
</style>

View File

@ -537,6 +537,7 @@
"stopException": "Stop error: {error}",
"allPlatformsCompleted": "✓ All platform simulations have ended",
"simCompleted": "✓ Simulation completed",
"simFailed": "✗ Simulation failed",
"reportRequestSent": "Report generation request sent, please wait...",
"startingReportGen": "Starting report generation...",
"reportGenTaskStarted": "✓ Report generation task started: {reportId}",

View File

@ -537,6 +537,7 @@
"stopException": "停止异常: {error}",
"allPlatformsCompleted": "✓ 检测到所有平台模拟已结束",
"simCompleted": "✓ 模拟已完成",
"simFailed": "✗ 模拟失败",
"reportRequestSent": "报告生成请求已发送,请稍候...",
"startingReportGen": "正在启动报告生成...",
"reportGenTaskStarted": "✓ 报告生成任务已启动: {reportId}",