From 1bbdce317a625d8a28a45ba1a47fef4ba22d9397 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Mon, 28 Sep 2026 17:28:55 +0300 Subject: [PATCH] chore: web_diag keeps its doc comment; sentinel marker written with \n #1521 inserted crash_log between web_diag's doc comment and its module, so the comment documented crash_log instead. #1519 wrote the survived marker with a literal line break inside the string. Co-Authored-By: Claude Opus 5.5 --- src/gpu_backend.rs | 3 +-- src/sys.rs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/gpu_backend.rs b/src/gpu_backend.rs index 632e85df1..a11f211e8 100644 --- a/src/gpu_backend.rs +++ b/src/gpu_backend.rs @@ -345,8 +345,7 @@ pub fn mark_sentinel_survived() { if text.lines().any(|l| l.trim() == SURVIVED_MARKER) { return; } - let _ = std::fs::write(&p, format!("{text}{SURVIVED_MARKER} -")); + let _ = std::fs::write(&p, format!("{text}{SURVIVED_MARKER}\n")); } pub fn arm_sentinel(backend: &str) { diff --git a/src/sys.rs b/src/sys.rs index 8cfcc66c2..ff3b2e40f 100644 --- a/src/sys.rs +++ b/src/sys.rs @@ -403,14 +403,6 @@ pub fn percent_encode(s: &str) -> String { out } -/// Web renderer-error surface (#414): wgpu / naga report pipeline and shader -/// failures through the `log` facade and then leave the canvas empty — with no -/// logger installed the message is lost, so a broken GPU path looks like "the -/// app draws nothing" with a clean console. Mirror every Error-level record to -/// the browser console AND into a fixed DOM banner whose text is selectable -/// (the canvas UI is not), with a one-click Copy button, so a failing user can -/// paste the exact error into a bug report. Panics land in the same banner via -/// a chained hook. /// Desktop crash log. /// /// A release build hides the console (`windows_subsystem = "windows"`) and is @@ -581,6 +573,14 @@ pub mod crash_log { } } +/// Web renderer-error surface (#414): wgpu / naga report pipeline and shader +/// failures through the `log` facade and then leave the canvas empty — with no +/// logger installed the message is lost, so a broken GPU path looks like "the +/// app draws nothing" with a clean console. Mirror every Error-level record to +/// the browser console AND into a fixed DOM banner whose text is selectable +/// (the canvas UI is not), with a one-click Copy button, so a failing user can +/// paste the exact error into a bug report. Panics land in the same banner via +/// a chained hook. #[cfg(target_arch = "wasm32")] pub mod web_diag { use std::sync::Mutex;