Skip to content

Improve WebView2 bootstrap recovery#231

Draft
Watanabehato wants to merge 1 commit into
MistEO:mainfrom
Watanabehato:fix-webview-bootstrap-recovery
Draft

Improve WebView2 bootstrap recovery#231
Watanabehato wants to merge 1 commit into
MistEO:mainfrom
Watanabehato:fix-webview-bootstrap-recovery

Conversation

@Watanabehato

@Watanabehato Watanabehato commented Jun 5, 2026

Copy link
Copy Markdown

Summary

  • add an early Windows bootstrap log before Tauri logging starts
  • mark WebView startup as pending and rotate cache/webview_data on the next launch if Tauri setup was never reached
  • avoid using an incomplete fixed WebView2 runtime and fall back to system/runtime install instead

Testing

  • git diff --check
  • Not run: cargo fmt/check, cargo is not available in this environment

Summary by Sourcery

提升 Windows WebView2 启动的健壮性和诊断能力,以从启动失败中恢复,并避免使用不完整的固定运行时。

New Features:

  • 在 Tauri 日志初始化之前,将早期的 Windows 启动日志记录到 debug/bootstrap.log 文件中。
  • 使用标记文件跟踪 WebView 启动状态,如果从未到达 Tauri setup 阶段,则在下次启动时触发缓存的 webview_data 轮换。

Bug Fixes:

  • 当缓存的固定 WebView2 运行时缺少必需文件时,跳过使用该缓存,改为回退到系统或运行时安装。
  • 通过备份并重新创建 webview_data 目录,从之前失败的 WebView 启动中恢复。

Enhancements:

  • 统一 Windows 可执行文件目录解析逻辑,并在各个启动辅助模块中复用。
  • 确保记录 WebView2 用户数据和运行时选择,以帮助排查启动相关问题。
Original summary in English

Summary by Sourcery

Improve Windows WebView2 startup robustness and diagnostics to recover from failed boots and avoid using incomplete fixed runtimes.

New Features:

  • Add early Windows bootstrap logging to a debug/bootstrap.log file before Tauri logging initializes.
  • Track WebView startup state with a marker file to trigger rotation of cached webview_data on the next launch if Tauri setup is never reached.

Bug Fixes:

  • Skip using a cached fixed WebView2 runtime when required files are missing and fall back to system or runtime installation instead.
  • Recover from previous failed WebView boots by backing up and recreating the webview_data directory.

Enhancements:

  • Centralize Windows executable directory resolution and reuse it across bootstrap helpers.
  • Ensure WebView2 user data and runtime selection are logged to aid troubleshooting of bootstrap issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant