Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Hide GPU problems from Slack (#18087)
Conrad Irwinedf2c1925001
diff --git a/crates/collab/src/api/events.rs b/crates/collab/src/api/events.rsindex 1be8f9c37b4..008c76e048b 100644--- a/crates/collab/src/api/events.rs+++ b/crates/collab/src/api/events.rs@@ -18,8 +18,8 @@ use sha2::{Digest, Sha256};use std::sync::{Arc, OnceLock};use telemetry_events::{ActionEvent, AppEvent, AssistantEvent, CallEvent, CpuEvent, EditEvent, EditorEvent, Event,- EventRequestBody, EventWrapper, ExtensionEvent, InlineCompletionEvent, MemoryEvent, ReplEvent,- SettingEvent,+ EventRequestBody, EventWrapper, ExtensionEvent, InlineCompletionEvent, MemoryEvent, Panic,+ ReplEvent, SettingEvent,};use uuid::Uuid;@@ -296,10 +296,11 @@ pub async fn post_panic(version = %panic.app_version,os_name = %panic.os_name,os_version = %panic.os_version.clone().unwrap_or_default(),- installation_id = %panic.installation_id.unwrap_or_default(),+ installation_id = %panic.installation_id.clone().unwrap_or_default(),description = %panic.payload,backtrace = %panic.backtrace.join("\n"),- "panic report");+ "panic report"+ );let backtrace = if panic.backtrace.len() > 25 {let total = panic.backtrace.len();@@ -317,6 +318,11 @@ pub async fn post_panic(} else {panic.backtrace.join("\n")};++ if !report_to_slack(&panic) {+ return Ok(());+ }+let backtrace_with_summary = panic.payload + "\n" + &backtrace;if let Some(slack_panics_webhook) = app.config.slack_panics_webhook.clone() {@@ -357,6 +363,23 @@ pub async fn post_panic(Ok(())}+fn report_to_slack(panic: &Panic) -> bool {+ if panic.os_name == "Linux" {+ if panic.payload.contains("ERROR_SURFACE_LOST_KHR") {+ return false;+ }++ if panic+ .payload+ .contains("GPU has crashed, and no debug information is available")+ {+ return false;+ }+ }++ true+}+pub async fn post_events(Extension(app): Extension<Arc<AppState>>,TypedHeader(ZedChecksumHeader(checksum)): TypedHeader<ZedChecksumHeader>,