openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Every internal tauri-runtime-wry error log becomes a Sentry event, split into one issue per WebView2 HRESULT and OS language

Open senamakel opened this issue 3 weeks ago • 2 comments

Milestone: Nov 9 - Nov 13 · Parent: tinyhumansai/team#46

Sentry issues covered

26 Sentry issue(s), 187 events in total, up to 10 users on a single issue. Releases seen: 0.64.4, 0.64.10, 0.64.14, 0.64.15.

Sentry Project Events Users Releases Last seen
TAURI-RUST-10SY tauri-rust 38 10 0.64.14, 0.64.15 2026-11-08
TAURI-RUST-11F9 tauri-rust 28 4 0.64.15 2026-11-05
TAURI-RUST-11FA tauri-rust 24 4 0.64.15 2026-11-05
TAURI-RUST-11J6 tauri-rust 20 6 0.64.15 2026-11-08
TAURI-RUST-1177 tauri-rust 19 0 0.64.15 2026-10-29
TAURI-RUST-11TA tauri-rust 13 2 0.64.15 2026-11-08
TAURI-RUST-1647 tauri-rust 6 1 0.64.10, 0.64.15 2026-11-08
TAURI-RUST-12X5 tauri-rust 6 0 0.64.15 2026-10-28
TAURI-RUST-12X2 tauri-rust 5 0 0.64.15, 0.64.4 2026-11-08
TAURI-RUST-168Z tauri-rust 4 0 0.64.15 2026-10-29
TAURI-RUST-168X tauri-rust 4 0 0.64.15 2026-10-29
TAURI-RUST-16JS tauri-rust 3 0 0.64.15 2026-11-08
TAURI-RUST-172K tauri-rust 2 1 0.64.15 2026-11-06
TAURI-RUST-167N tauri-rust 2 2 0.64.15 2026-11-05
TAURI-RUST-16GP tauri-rust 2 0 0.64.15 2026-10-31
TAURI-RUST-17AQ tauri-rust 1 0 0.64.15 2026-11-09
TAURI-RUST-176S tauri-rust 1 0 0.64.15 2026-11-08
TAURI-RUST-174G tauri-rust 1 0 0.64.15 2026-11-06
TAURI-RUST-172T tauri-rust 1 1 0.64.15 2026-11-06
TAURI-RUST-171A tauri-rust 1 0 0.64.15 2026-11-06
6 more Sentry issues in this group

TAURI-RUST-16KF, TAURI-RUST-16KE, TAURI-RUST-16JT, TAURI-RUST-16G6, TAURI-RUST-168Y, TAURI-RUST-167R

What happens

tauri-runtime-wry logs its own failures with log::error! (failed to focus webview: {e}, failed to autoresize webview: {e}, and bare {e} when a window or child webview cannot be created, which renders as failed to create webview: WebView2 error: ...). The shell bridges log into tracing, and the core's Sentry layer turns every ERROR-level event from any target into a Sentry event. The message embeds the HRESULT text in the user's Windows language, so one condition becomes many issues: 26 issues here (E_INVALIDARG and Class not registered on focus, 0x8007139F on autoresize, invalid window handle / resource in use / timeout on create, in English, Chinese, Korean, German, Russian, Portuguese, Spanish, French). Focus/resize failures are cosmetic and retried by our own focus code. Create failures are real (a window or child webview does not appear), but the runtime swallows the error, so the app cannot react to it. TAURI-RUST-1177 (Could not find the webview runtime, 19 events) is a machine without the WebView2 runtime.

Likely code path

  • crates/openhuman-core/src/core/logging.rs sentry_tracing_layer: Level::ERROR => EventFilter::Event for every target
  • crates/openhuman-app/src/file_logging.rs / openhuman_rpc::embed::process::init_for_embedded: LogTracer bridge that forwards dependency log records
  • tauri-runtime-wry 2.11 src/lib.rs: log::error!("failed to focus webview: {e}") (~3969), failed to autoresize webview (~4343), Message::CreateWebview / CreateWindow error arms log::error!("{e}") (~4071, ~4081)
  • crates/openhuman-app/tauri.conf.json bundle.windows: no webviewInstallMode

Suggested fix

  • In sentry_tracing_layer, map ERROR events whose target starts with tauri_runtime_wry to breadcrumbs, except window/webview creation failures, which should be captured once with a stable fingerprint built from the HRESULT code (parse HRESULT(0x...)), not the localized text.
  • Set bundle.windows.webviewInstallMode (e.g. embedBootstrapper or downloadBootstrapper) so installs without WebView2 get it, and show a clear message instead of the generic runtime error.
  • Regression test: the layer's filter returns Breadcrumb for a tauri_runtime_wry focus/resize record and Event for an openhuman_* error.

Done when

  • [ ] A regression test reproduces the failure (or the misreport) and passes with the fix
  • [ ] The fix is merged to main
  • [ ] The Sentry issues above are resolved in the next release, and stay quiet on builds that carry the fix

senamakel avatar Nov 09 '26 13:11 senamakel

tauri-runtime-wry's own internal error logs are forwarded through the log->tracing bridge and captured as Sentry events by sentry_tracing_layer, so one localized WebView2 HRESULT condition explodes into 26 separate Sentry issues. Suggested fix: filter tauri_runtime_wry ERROR records down to breadcrumbs (except webview/window creation failures, which get a stable HRESULT-based fingerprint), set bundle.windows.webviewInstallMode so installs lacking WebView2 are handled, and add a regression test for the filter.

Labelled priority: p2.

tinysweeper avatar Nov 09 '26 13:11 tinysweeper