Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Add is_staff and destination to download events (#15445)
Joseph T. Lyons0702ed5cd698
diff --git a/crates/auto_update/src/auto_update.rs b/crates/auto_update/src/auto_update.rsindex b6868f56430..6e52154c1b2 100644--- a/crates/auto_update/src/auto_update.rs+++ b/crates/auto_update/src/auto_update.rs@@ -55,6 +55,8 @@ struct UpdateRequestBody {installation_id: Option<Arc<str>>,release_channel: Option<&'static str>,telemetry: bool,+ is_staff: Option<bool>,+ destination: &'static str,}#[derive(Clone, PartialEq, Eq)]@@ -575,18 +577,27 @@ async fn download_remote_server_binary(cx: &AsyncAppContext,) -> Result<()> {let mut target_file = File::create(&target_path).await?;- let (installation_id, release_channel, telemetry) = cx.update(|cx| {- let installation_id = Client::global(cx).telemetry().installation_id();+ let (installation_id, release_channel, telemetry_enabled, is_staff) = cx.update(|cx| {+ let telemetry = Client::global(cx).telemetry().clone();+ let is_staff = telemetry.is_staff();+ let installation_id = telemetry.installation_id();let release_channel =ReleaseChannel::try_global(cx).map(|release_channel| release_channel.display_name());- let telemetry = TelemetrySettings::get_global(cx).metrics;+ let telemetry_enabled = TelemetrySettings::get_global(cx).metrics;- (installation_id, release_channel, telemetry)+ (+ installation_id,+ release_channel,+ telemetry_enabled,+ is_staff,+ )})?;let request_body = AsyncBody::from(serde_json::to_string(&UpdateRequestBody {installation_id,release_channel,- telemetry,+ telemetry: telemetry_enabled,+ is_staff,+ destination: "remote",})?);let mut response = client.get(&release.url, request_body, true).await?;@@ -602,19 +613,28 @@ async fn download_release() -> Result<()> {let mut target_file = File::create(&target_path).await?;- let (installation_id, release_channel, telemetry) = cx.update(|cx| {- let installation_id = Client::global(cx).telemetry().installation_id();+ let (installation_id, release_channel, telemetry_enabled, is_staff) = cx.update(|cx| {+ let telemetry = Client::global(cx).telemetry().clone();+ let is_staff = telemetry.is_staff();+ let installation_id = telemetry.installation_id();let release_channel =ReleaseChannel::try_global(cx).map(|release_channel| release_channel.display_name());- let telemetry = TelemetrySettings::get_global(cx).metrics;+ let telemetry_enabled = TelemetrySettings::get_global(cx).metrics;- (installation_id, release_channel, telemetry)+ (+ installation_id,+ release_channel,+ telemetry_enabled,+ is_staff,+ )})?;let request_body = AsyncBody::from(serde_json::to_string(&UpdateRequestBody {installation_id,release_channel,- telemetry,+ telemetry: telemetry_enabled,+ is_staff,+ destination: "local",})?);let mut response = client.get(&release.url, request_body, true).await?;