Fix add-phone handoff and SMS Bower rotation

This commit is contained in:
chick
2026-05-31 01:31:19 +08:00
parent 39af4f9ca4
commit c360e3f569
4 changed files with 65 additions and 6 deletions
+7 -3
View File
@@ -176,7 +176,7 @@ test('step 7 preserves visible step when refreshing OAuth after retry', async ()
assert.deepStrictEqual(events.refreshSteps, [9, 9, 9]);
});
test('step 7 hands add-phone to the dedicated post-login phone node without internal retry', async () => {
test('step 7 hands add-phone to the dedicated post-login phone node without internal retry and keeps login code node active', async () => {
const source = fs.readFileSync('flows/openai/background/steps/oauth-login.js', 'utf8');
const globalScope = {};
const api = new Function('self', `${source}; return self.MultiPageBackgroundStep7;`)(globalScope);
@@ -222,12 +222,16 @@ test('step 7 hands add-phone to the dedicated post-login phone node without inte
step: 'oauth-login',
payload: {
loginVerificationRequestedAt: null,
skipLoginVerificationStep: true,
addPhonePage: true,
phoneVerificationPage: false,
directOAuthConsentPage: false,
},
},
]);
assert.ok(
!Object.prototype.hasOwnProperty.call(events.completions[0].payload, 'skipLoginVerificationStep'),
'add-phone handoff must keep the login-code node active so step 9 phone verification can run next'
);
assert.ok(
!events.logs.some(({ message }) => /准备重试/.test(message)),
'add-phone failure should not be logged as an internal retryable attempt'
@@ -291,8 +295,8 @@ test('step 7 no longer runs shared phone verification inside oauth-login', async
step: 'oauth-login',
payload: {
loginVerificationRequestedAt: null,
skipLoginVerificationStep: true,
addPhonePage: true,
phoneVerificationPage: false,
directOAuthConsentPage: false,
},
},