Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
WIP
Antonio Scandurra48033463c82f
diff --git a/crates/client2/src/telemetry.rs b/crates/client2/src/telemetry.rsindex 2c29e1231fd..8804ee60b92 100644--- a/crates/client2/src/telemetry.rs+++ b/crates/client2/src/telemetry.rs@@ -41,9 +41,9 @@ struct ClickhouseEventRequestBody {installation_id: Option<Arc<str>>,session_id: Option<Arc<str>>,is_staff: Option<bool>,- app_version: Option<Arc<str>>,+ app_version: Option<String>,os_name: &'static str,- os_version: Option<Arc<str>>,+ os_version: Option<String>,architecture: &'static str,release_channel: Option<&'static str>,events: Vec<ClickhouseEventWrapper>,@@ -190,7 +190,13 @@ impl Telemetry {core_count: system.cpus().len() as u32,};- let telemetry_settings = cx.update(|cx| *settings2::get::<TelemetrySettings>(cx));+ let telemetry_settings = if let Ok(telemetry_settings) =+ cx.update(|cx| *settings2::get::<TelemetrySettings>(cx))+ {+ telemetry_settings+ } else {+ break;+ };this.report_clickhouse_event(memory_event, telemetry_settings);this.report_clickhouse_event(cpu_event, telemetry_settings);@@ -287,9 +293,15 @@ impl Telemetry {installation_id: state.installation_id.clone(),session_id: state.session_id.clone(),is_staff: state.is_staff.clone(),- app_version: state.app_version.clone(),- os_name: state.os_name,- os_version: state.os_version.clone(),+ app_version: state+ .app_metadata+ .app_version+ .map(|version| version.to_string()),+ os_name: state.app_metadata.os_name,+ os_version: state+ .app_metadata+ .os_version+ .map(|version| version.to_string()),architecture: state.architecture,release_channel: state.release_channel,diff --git a/crates/gpui2/src/app.rs b/crates/gpui2/src/app.rsindex 12f9aa19139..a3b4615445d 100644--- a/crates/gpui2/src/app.rs+++ b/crates/gpui2/src/app.rs@@ -59,8 +59,8 @@ impl App {let unit_entity = entities.insert(entities.reserve(), ());let app_metadata = AppMetadata {os_name: platform.os_name(),- os_version: platform.os_version().unwrap_or_default(),- app_version: platform.app_version().unwrap_or_default(),+ os_version: platform.os_version().ok(),+ app_version: platform.app_version().ok(),};Self(Arc::new_cyclic(|this| {Mutex::new(AppContext {diff --git a/crates/gpui2/src/platform.rs b/crates/gpui2/src/platform.rsindex 6e2243ba40c..fc5d242bc71 100644--- a/crates/gpui2/src/platform.rs+++ b/crates/gpui2/src/platform.rs@@ -184,8 +184,8 @@ pub trait PlatformTextSystem: Send + Sync {#[derive(Clone, Debug)]pub struct AppMetadata {pub os_name: &'static str,- pub os_version: SemanticVersion,- pub app_version: SemanticVersion,+ pub os_version: Option<SemanticVersion>,+ pub app_version: Option<SemanticVersion>,}#[derive(PartialEq, Eq, Hash, Clone)]