diff --git a/background/steps/fetch-login-code.js b/background/steps/fetch-login-code.js index 3ad3fb3..a812cf9 100644 --- a/background/steps/fetch-login-code.js +++ b/background/steps/fetch-login-code.js @@ -551,7 +551,7 @@ }, targetEmail: fixedTargetEmail, maxResendRequests: mail.provider === '2925' ? 1 : undefined, - initialPollMaxAttempts: mail.provider === '2925' ? 5 : undefined, + initialPollMaxAttempts: mail.provider === '2925' ? 2 : undefined, resendIntervalMs: mail.provider === LUCKMAIL_PROVIDER ? 15000 : ((mail.provider === HOTMAIL_PROVIDER || mail.provider === '2925') diff --git a/tests/background-step7-recovery.test.js b/tests/background-step7-recovery.test.js index e32d7e3..9bc9e71 100644 --- a/tests/background-step7-recovery.test.js +++ b/tests/background-step7-recovery.test.js @@ -1056,7 +1056,7 @@ test('step 8 completes when polling fails but recovery probe shows oauth consent ]); }); -test('step 8 uses a fixed 10-minute lookback window and delays 2925 resend until after one full poll', async () => { +test('step 8 uses a fixed 10-minute lookback window and delays 2925 resend until after two quick polls', async () => { let capturedOptions = null; let ensureCalls = 0; let ensureOptions = null; @@ -1149,7 +1149,7 @@ test('step 8 uses a fixed 10-minute lookback window and delays 2925 resend until assert.equal(capturedOptions.filterAfterTimestamp, 300000); assert.equal(capturedOptions.resendIntervalMs, 0); assert.equal(capturedOptions.maxResendRequests, 1); - assert.equal(capturedOptions.initialPollMaxAttempts, 5); + assert.equal(capturedOptions.initialPollMaxAttempts, 2); assert.equal(capturedOptions.targetEmail, ''); assert.equal(capturedOptions.beforeSubmit, undefined); assert.equal(typeof capturedOptions.getRemainingTimeMs, 'function'); diff --git a/tests/verification-flow-polling.test.js b/tests/verification-flow-polling.test.js index 447c9db..f3a4a9f 100644 --- a/tests/verification-flow-polling.test.js +++ b/tests/verification-flow-polling.test.js @@ -835,7 +835,7 @@ test('verification flow keeps 2925 mailbox polling at 15 refresh attempts even w assert.ok(pollCall.options.timeoutMs >= 250000); }); -test('verification flow delays 2925 login resend until after the first full mailbox poll fails', async () => { +test('verification flow delays 2925 login resend until after the first quick mailbox poll fails', async () => { const events = []; const pollMaxAttempts = []; let pollCalls = 0; @@ -894,7 +894,7 @@ test('verification flow delays 2925 login resend until after the first full mail { provider: '2925', label: '2925 邮箱' }, { maxResendRequests: 1, - initialPollMaxAttempts: 5, + initialPollMaxAttempts: 2, requestFreshCodeFirst: false, filterAfterTimestamp: 123, resendIntervalMs: 0, @@ -902,7 +902,7 @@ test('verification flow delays 2925 login resend until after the first full mail ); assert.deepStrictEqual(events.slice(0, 3), ['poll', 'resend', 'poll']); - assert.deepStrictEqual(pollMaxAttempts.slice(0, 2), [5, 15]); + assert.deepStrictEqual(pollMaxAttempts.slice(0, 2), [2, 15]); assert.equal(events.filter((event) => event === 'resend').length, 1); }); @@ -969,14 +969,14 @@ test('verification flow uses full 2925 polling window after a rejected login cod { provider: '2925', label: '2925 邮箱' }, { maxResendRequests: 0, - initialPollMaxAttempts: 5, + initialPollMaxAttempts: 2, requestFreshCodeFirst: false, filterAfterTimestamp: 123, resendIntervalMs: 0, } ); - assert.deepStrictEqual(pollMaxAttempts, [5, 15]); + assert.deepStrictEqual(pollMaxAttempts, [2, 15]); assert.deepStrictEqual(submittedCodes, ['111111', '222222']); });