From c063561a11643278273fdbb07d3c03e14ab19308 Mon Sep 17 00:00:00 2001 From: QLHazyCoder <2825305047@qq.com> Date: Mon, 11 May 2026 15:10:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=E4=BB=A5=E9=98=B2=E6=AD=A2?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E8=AE=A2=E9=98=85=20ChatGPT=20=E5=A5=97?= =?UTF-8?q?=E9=A4=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- background.js | 2 +- tests/auto-run-step6-restart.test.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/background.js b/background.js index 25cb903..63ee547 100644 --- a/background.js +++ b/background.js @@ -7758,7 +7758,7 @@ function isPhoneSmsPlatformRateLimitFailure(error) { function isPlusCheckoutNonFreeTrialFailure(error) { const message = getErrorMessage(error); - return /PLUS_CHECKOUT_NON_FREE_TRIAL::|今日应付金额不是\s*0|没有免费试用资格/i.test(message); + return /PLUS_CHECKOUT_NON_FREE_TRIAL::|今日应付金额不是\s*0|没有免费试用资格|该账号已经开通过\s*ChatGPT\s*订阅套餐,不能重复订阅(?:。)?(?:(\s*checkout_order\s*)|\(\s*checkout_order\s*\))?/i.test(message); } function isGpcTaskEndedFailure(error) { diff --git a/tests/auto-run-step6-restart.test.js b/tests/auto-run-step6-restart.test.js index 2a87a35..70ea3f8 100644 --- a/tests/auto-run-step6-restart.test.js +++ b/tests/auto-run-step6-restart.test.js @@ -781,3 +781,31 @@ test('auto-run does not restart GPC checkout when Plus account has no free-trial assert.deepStrictEqual(result.events.steps, [6, 7]); assert.equal(result.events.invalidations.length, 0); }); + +test('auto-run does not restart GPC checkout when account already has a ChatGPT subscription', async () => { + const plusGpcSteps = { + 6: { key: 'plus-checkout-create' }, + 7: { key: 'plus-checkout-billing' }, + 10: { key: 'oauth-login' }, + }; + const harness = createHarness({ + startStep: 6, + failureStep: 7, + failureBudget: 1, + failureMessage: 'GPC_TASK_ENDED::该账号已经开通过ChatGPT订阅套餐,不能重复订阅。(checkout_order)', + stepDefinitions: plusGpcSteps, + finalOAuthChainStartStep: 10, + customState: { + stepStatuses: { 3: 'completed' }, + plusPaymentMethod: 'gpc-helper', + plusCheckoutSource: 'gpc-helper', + }, + }); + + const result = await harness.runAndCaptureError(); + + assert.ok(result?.error); + assert.deepStrictEqual(result.events.steps, [6, 7]); + assert.equal(result.events.invalidations.length, 0); + assert.ok(!result.events.logs.some(({ message }) => /回到步骤 6 重新创建 GPC 任务/.test(message))); +});