refactor: 移除网络超时相关逻辑,简化错误处理

This commit is contained in:
QLHazyCoder
2026-04-19 03:28:15 +08:00
parent e8b8af47c4
commit afef124856
9 changed files with 8 additions and 199 deletions
-36
View File
@@ -87,8 +87,6 @@ test('ensureStep8VerificationPageReady throws cloudflare security block error on
const api = new Function(`
const CLOUDFLARE_SECURITY_BLOCK_ERROR_PREFIX = 'CF_SECURITY_BLOCKED::';
const CLOUDFLARE_SECURITY_BLOCK_USER_MESSAGE = 'cloudflare blocked';
const NETWORK_TIMEOUT_BLOCK_ERROR_PREFIX = 'NETWORK_TIMEOUT_BLOCKED::';
const NETWORK_TIMEOUT_BLOCK_USER_MESSAGE = 'network timeout blocked';
function getLoginAuthStateLabel(state) {
return state === 'login_timeout_error_page' ? 'login timeout page' : 'unknown page';
@@ -117,40 +115,6 @@ return {
);
});
test('ensureStep8VerificationPageReady throws network timeout block error on operation timed out page', async () => {
const api = new Function(`
const CLOUDFLARE_SECURITY_BLOCK_ERROR_PREFIX = 'CF_SECURITY_BLOCKED::';
const CLOUDFLARE_SECURITY_BLOCK_USER_MESSAGE = 'cloudflare blocked';
const NETWORK_TIMEOUT_BLOCK_ERROR_PREFIX = 'NETWORK_TIMEOUT_BLOCKED::';
const NETWORK_TIMEOUT_BLOCK_USER_MESSAGE = 'network timeout blocked';
function getLoginAuthStateLabel(state) {
return state === 'login_timeout_error_page' ? 'login timeout page' : 'unknown page';
}
async function getLoginAuthStateFromContent() {
return {
state: 'login_timeout_error_page',
url: 'https://auth.openai.com/log-in',
operationTimedOutBlocked: true,
};
}
${extractFunction(backgroundSource, 'ensureStep8VerificationPageReady')}
return {
run() {
return ensureStep8VerificationPageReady({});
},
};
`)();
await assert.rejects(
() => api.run(),
/NETWORK_TIMEOUT_BLOCKED::/
);
});
test('step 8 reruns step 7 when auth page enters login timeout retry state', async () => {
const calls = {
executeStep7: 0,