fix: restart signup phone mismatch without duplicate logs
This commit is contained in:
@@ -166,7 +166,9 @@
|
||||
const retryCount = getAutoRunRoundRetryCount(item);
|
||||
const finalReason = item.finalFailureReason || item.failureReasons[item.failureReasons.length - 1] || '未知错误';
|
||||
const reasonSummary = formatAutoRunFailureReasons(item.failureReasons);
|
||||
return `第 ${item.round} 轮(重试 ${retryCount} 次,最终原因:${finalReason};失败记录:${reasonSummary})`;
|
||||
return !reasonSummary || reasonSummary === finalReason
|
||||
? `第 ${item.round} 轮(重试 ${retryCount} 次,最终原因:${finalReason})`
|
||||
: `第 ${item.round} 轮(重试 ${retryCount} 次,最终原因:${finalReason};失败记录:${reasonSummary})`;
|
||||
})
|
||||
.join(';')}`,
|
||||
'error'
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
|
||||
function isRestartCurrentAttemptError(error) {
|
||||
const message = String(typeof error === 'string' ? error : error?.message || '');
|
||||
return /当前邮箱已存在,需要重新开始新一轮/.test(message);
|
||||
return /当前邮箱已存在,需要重新开始新一轮|SIGNUP_PHONE_PASSWORD_MISMATCH::/i.test(message);
|
||||
}
|
||||
|
||||
function isSignupUserAlreadyExistsFailure(error) {
|
||||
|
||||
@@ -587,15 +587,20 @@
|
||||
notifyStepError(message.step, '流程已被用户停止。');
|
||||
return { ok: true, error: userMessage };
|
||||
}
|
||||
const currentState = await getState();
|
||||
const currentStepStatus = currentState?.stepStatuses?.[message.step] || '';
|
||||
const isSignupPhonePasswordMismatch = /SIGNUP_PHONE_PASSWORD_MISMATCH::/i.test(String(message.error || ''));
|
||||
if (isStopError(message.error)) {
|
||||
await setStepStatus(message.step, 'stopped');
|
||||
await addLog('已被用户停止', 'warn', { step: message.step });
|
||||
await appendManualAccountRunRecordIfNeeded(`step${message.step}_stopped`, null, message.error);
|
||||
notifyStepError(message.step, message.error);
|
||||
} else {
|
||||
await setStepStatus(message.step, 'failed');
|
||||
await addLog(`失败:${message.error}`, 'error', { step: message.step });
|
||||
await appendManualAccountRunRecordIfNeeded(`step${message.step}_failed`, null, message.error);
|
||||
if (!(isSignupPhonePasswordMismatch && currentStepStatus === 'failed')) {
|
||||
await setStepStatus(message.step, 'failed');
|
||||
await addLog(`失败:${message.error}`, 'error', { step: message.step });
|
||||
await appendManualAccountRunRecordIfNeeded(`step${message.step}_failed`, null, message.error);
|
||||
}
|
||||
notifyStepError(message.step, message.error);
|
||||
}
|
||||
return { ok: true };
|
||||
|
||||
Reference in New Issue
Block a user