Refactor GPC plus flow to page recharge

This commit is contained in:
QLHazyCoder
2026-05-29 10:09:26 +08:00
parent 9ef9cb4c46
commit 56f52cb858
40 changed files with 1278 additions and 5203 deletions
+11 -11
View File
@@ -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;