#6167·wails

[v3][Windows] WebView2 recovery failures can still exit the app or strand its controller

Author: taliesin-aiCreated Sep 24, 2026Updated Sep 30, 2026
LabelsBugv3WindowsP2

The two recovery failure paths discussed in PR #6002 remain in master after its merge (075dded01). The original browser/renderer crash recovery landed, but the locally prepared follow-up fixes were not included.

Reproduction and current behavior

These are confirmed by inspecting the merged code; live fault injection for these paths has not yet been run.

  1. Trigger browser-process recovery and let EmbedWithError succeed, then make a post-embed configuration COM call fail (for example GetSettings, a settings setter, background colour, or the resource filter). setupChromium(true) still calls the fatal application handler or Chromium.errorCallback, which terminates the Wails host.
  2. Trigger browser-process recovery and make replacement initialization fail once. rebuildWebView shuts down the previous Chromium instance, then restores that same abandoned instance when setupChromium(true) returns false. The recovery callback clears its pending flag without scheduling another replacement; the abandoned instance suppresses ProcessFailed callbacks, so the window can remain blank until restart.

Review evidence:

The native Windows report on #6002 covers the earlier 050069f94 implementation and explicitly excludes live initialization-failure injection: https://github.com/wailsapp/wails/pull/6002#issuecomment-5823484141.

Scope and acceptance

  • Recovery configuration errors return to the recovery caller without terminating the host; initial startup retains its existing fatal behavior.
  • Close partially initialized/abandoned controllers and retry with fresh instances within the existing three-attempt budget.
  • Keep the pending guard across retries, stop on teardown, and never restore an abandoned instance.
  • Verify transient initialization failure followed by success, budget exhaustion, configuration HRESULT propagation, COM cleanup, and repeated close.
  • Run the regression tests on native Windows and validate injected initialization/configuration failures in a live WebView2 app.

The focused follow-up is committed locally at 51a81d85b36095f3b4abf24ab3779854442e3e63 on codex/ga-6167-recovery-failures and includes master 08bdd6dac3ac02be9985170dd220afa066230635. It contains 73ba9efe4 (configuration/retry cleanup) and aa64a0f4d (safe zoom commands when no controller remains). The original preparation remains preserved at a98e2a9ee.

Windows amd64/arm64 application and edge test binaries, plus the production application variant, compile; Windows amd64 vet with -unsafeptr=false, formatting, and diff checks pass. CodeRabbit reviewed the initial seven-file follow-up in 73ba9efe4 with zero findings. After its quota reset, a committed-change review of aa64a0f4d against 73ba9efe4 also completed with zero findings for the zoom guard and regression test. The getZoom contract check reports an unchanged signature with no incompatible callers.

Structural scans of the committed changes report repeated COM guard/release patterns, Go test entry points, and the existing setup sequence extracted into configureChromium. The small zoom guard also triggers a clone heuristic against unrelated registry parsing. These findings were reviewed and retained; the structural gate is not claimed as passing.

Native execution/live fault injection remain pending because SSH authentication to win-node1 failed. The independent callback ownership gap is tracked in #6168 and implemented by PR #6184; the combined native recovery/lifetime behavior is not yet verified. Nothing has been pushed; explicit manual confirmation remains required. This is a Windows runtime bug in v3.0.0 GA/nightly patch scope, outside the features-only v3.1.0 milestone.

Latest local synchronization (2026-09-30): Master 08bdd6dac includes only generated contributor/sponsor SVG updates since the previous synchronization: a contributor profile rename/reordering and two sponsor additions. The local merge exactly matches both upstream assets; XML parsing, embedded-image encoding, unchanged dimensions, and diff checks pass. The required coderabbit --plain command was attempted but is unsupported by the installed CLI; coderabbit review --uncommitted reported no files to review for this SVG-only change, so no CodeRabbit pass is claimed for this merge. Ripwire reports zero structural regressions for the merge delta (measured at ea29e1bd3+dirty before the commit). No runtime source changed, so the earlier source validation remains applicable. The temporary checkout had disappeared; the committed fixes were recovered unchanged into a persistent local worktree before synchronization. Previous temporary logs and compiled test binaries are no longer present; their historical results above were not rerun or reclassified as new validation. This merge is committed as taliesin-ai in a clean worktree; nothing has been pushed.