Refactor GPC plus flow to page recharge
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
getState,
|
||||
hasSavedNodeProgress,
|
||||
isAddPhoneAuthFailure,
|
||||
isGpcTaskEndedFailure,
|
||||
isGpcPageFlowEndedFailure,
|
||||
isKiroProxyFailure,
|
||||
isPhoneSmsPlatformRateLimitFailure,
|
||||
isPlusCheckoutNonFreeTrialFailure,
|
||||
@@ -806,9 +806,9 @@
|
||||
&& isAddPhoneAuthFailure(err);
|
||||
const blockedByPlusNonFreeTrial = typeof isPlusCheckoutNonFreeTrialFailure === 'function'
|
||||
&& isPlusCheckoutNonFreeTrialFailure(err);
|
||||
const blockedByGpcTaskEnded = typeof isGpcTaskEndedFailure === 'function'
|
||||
? isGpcTaskEndedFailure(err)
|
||||
: /GPC_TASK_ENDED::/i.test(err?.message || String(err || ''));
|
||||
const blockedByGpcPageFlowEnded = typeof isGpcPageFlowEndedFailure === 'function'
|
||||
? isGpcPageFlowEndedFailure(err)
|
||||
: /GPC_PAGE_FLOW_ENDED::/i.test(err?.message || String(err || ''));
|
||||
const blockedBySignupUserAlreadyExists = typeof isSignupUserAlreadyExistsFailure === 'function'
|
||||
&& !keepSameEmailUntilAddPhone
|
||||
&& isSignupUserAlreadyExistsFailure(err);
|
||||
@@ -819,7 +819,7 @@
|
||||
const canRetry = !blockedByAddPhone
|
||||
&& !blockedByPhoneNoSupply
|
||||
&& !blockedByPlusNonFreeTrial
|
||||
&& !blockedByGpcTaskEnded
|
||||
&& !blockedByGpcPageFlowEnded
|
||||
&& !blockedBySignupUserAlreadyExists
|
||||
&& !blockedByStep4Route405
|
||||
&& !blockedByKiroProxy
|
||||
@@ -935,18 +935,18 @@
|
||||
break;
|
||||
}
|
||||
|
||||
if (blockedByGpcTaskEnded) {
|
||||
if (blockedByGpcPageFlowEnded) {
|
||||
roundSummary.status = 'failed';
|
||||
roundSummary.finalFailureReason = reason;
|
||||
await setState({
|
||||
autoRunRoundSummaries: serializeAutoRunRoundSummaries(totalRuns, roundSummaries),
|
||||
});
|
||||
await appendRoundRecordIfNeeded('failed', reason, err);
|
||||
cancelPendingCommands('当前轮因 GPC 任务已结束。');
|
||||
cancelPendingCommands('当前轮因 GPC 页面流程已结束。');
|
||||
await broadcastStopToContentScripts();
|
||||
if (!autoRunSkipFailures) {
|
||||
await addLog(
|
||||
`第 ${targetRun}/${totalRuns} 轮 GPC 任务已结束,自动重试未开启,当前自动运行将停止。`,
|
||||
`第 ${targetRun}/${totalRuns} 轮 GPC 页面流程已结束,自动重试未开启,当前自动运行将停止。`,
|
||||
'warn'
|
||||
);
|
||||
stoppedEarly = true;
|
||||
@@ -959,11 +959,11 @@
|
||||
break;
|
||||
}
|
||||
|
||||
await addLog(`第 ${targetRun}/${totalRuns} 轮 GPC 任务已结束,本轮将直接失败并跳过剩余重试。`, 'warn');
|
||||
await addLog(`第 ${targetRun}/${totalRuns} 轮 GPC 页面流程已结束,本轮将直接失败并跳过剩余重试。`, 'warn');
|
||||
await addLog(
|
||||
targetRun < totalRuns
|
||||
? `第 ${targetRun}/${totalRuns} 轮因 GPC 任务结束提前结束,自动流程将继续下一轮。`
|
||||
: `第 ${targetRun}/${totalRuns} 轮因 GPC 任务结束提前结束,已无后续轮次,本次自动运行结束。`,
|
||||
? `第 ${targetRun}/${totalRuns} 轮因 GPC 页面流程结束提前结束,自动流程将继续下一轮。`
|
||||
: `第 ${targetRun}/${totalRuns} 轮因 GPC 页面流程结束提前结束,已无后续轮次,本次自动运行结束。`,
|
||||
'warn'
|
||||
);
|
||||
forceFreshTabsNextRun = true;
|
||||
|
||||
Reference in New Issue
Block a user