收口桌面壳生命周期诊断日志

桌面壳生命周期事件失败只记录固定阶段标签

扩展桌面壳配置门禁禁止生命周期日志输出 Tauri 错误细节

补充宿主壳方案和共享决策中的生命周期诊断边界
This commit is contained in:
2026-06-21 02:35:24 +08:00
parent f262c69041
commit 6066a7be4f
4 changed files with 48 additions and 5 deletions
@@ -193,6 +193,14 @@ const desktopShellNavigationSource = fs.readFileSync(
desktopShellNavigationPath,
'utf8',
);
const desktopShellLifecyclePath = new URL(
'../src-tauri/src/shell/lifecycle.rs',
import.meta.url,
);
const desktopShellLifecycleSource = fs.readFileSync(
desktopShellLifecyclePath,
'utf8',
);
const stageReleaseBinaryPath = new URL(
'../scripts/stage-release-binary.mjs',
import.meta.url,
@@ -2595,6 +2603,7 @@ const requiredRustHostSnippets = [
'resolve_desktop_lifecycle_window_flag',
'emit_current_desktop_lifecycle_event',
'desktop_lifecycle_window_flag_logs_failure_and_uses_default',
'desktop_lifecycle_window_flag_logs_stable_label_only',
'"background"',
'"hidden"',
'"minimized"',
@@ -2619,6 +2628,7 @@ const requiredRustHostSnippets = [
'PageLoadEvent::Finished',
'replay_desktop_webview_state',
'log_desktop_host_event_result',
'desktop_host_event_result_logs_stable_label_only',
'resolve_desktop_lifecycle_window_flag("visible",',
'resolve_desktop_lifecycle_window_flag("minimized",',
'resolve_desktop_lifecycle_window_flag(\n "focused",',
@@ -3347,3 +3357,14 @@ if (
) {
throw new Error('desktop deep-link diagnostics must not log plugin error details');
}
if (
desktopShellLifecycleSource.includes(
'desktop host event failed for app.lifecycle.{label}: {error}',
) ||
desktopShellLifecycleSource.includes(
'desktop host event failed for {label}: {error}',
)
) {
throw new Error('desktop lifecycle diagnostics must not log Tauri error details');
}