chore: preserve step-aware logging after upstream sync

- 吸收 master 的核心改动:按可见步骤归类日志显示,覆盖 OAuth、手机号验证、平台验证和内容脚本日志链路。

- 本地补充修复:保留平台验证成功后的手机号接码确认收尾,避免 #193/#194 恢复的手机号复用链路被合并覆盖。

- 影响范围:background routing、phone verification、platform verify、content scripts、sidepanel 与相关测试/文档。
This commit is contained in:
QLHazyCoder
2026-05-04 04:41:49 +08:00
25 changed files with 690 additions and 290 deletions
+18 -3
View File
@@ -339,6 +339,8 @@
timeoutMs = 30000,
retryDelayMs = 700,
logMessage = '',
logStep = null,
logStepKey = '',
} = options;
const start = Date.now();
@@ -399,7 +401,10 @@
if (logMessage && !logged) {
console.warn(LOG_PREFIX, `[ensureContentScriptReadyOnTab] ${source} tab=${tabId} still not ready after ${Date.now() - start}ms`);
await addLog(logMessage, 'warn');
await addLog(logMessage, 'warn', {
step: logStep,
stepKey: logStepKey,
});
logged = true;
}
@@ -670,6 +675,8 @@
timeoutMs = 30000,
retryDelayMs = 600,
logMessage = '',
logStep = null,
logStepKey = '',
responseTimeoutMs,
} = options;
const start = Date.now();
@@ -701,7 +708,10 @@
lastError = err;
if (logMessage && !logged) {
await addLog(logMessage, 'warn');
await addLog(logMessage, 'warn', {
step: logStep,
stepKey: logStepKey,
});
logged = true;
}
@@ -716,6 +726,8 @@
const {
timeoutMs = 45000,
maxRecoveryAttempts = 2,
logStep = null,
logStepKey = '',
responseTimeoutMs,
} = options;
const start = Date.now();
@@ -745,7 +757,10 @@
lastError = err;
if (!logged) {
await addLog(`步骤 ${message.step}${mail.label} 页面通信异常,正在尝试让邮箱页重新就绪...`, 'warn');
await addLog(`${mail.label} 页面通信异常,正在尝试让邮箱页重新就绪...`, 'warn', {
step: logStep,
stepKey: logStepKey,
});
logged = true;
}