Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Use insert_id as partition key for crash events (#28293)

Max Brunsfeld0dc3dffe3839
diff --git a/crates/collab/src/api/events.rs b/crates/collab/src/api/events.rs
index 011ae13d655..56db4e5e3e5 100644
--- a/crates/collab/src/api/events.rs
+++ b/crates/collab/src/api/events.rs
@@ -161,16 +161,22 @@ pub async fn post_crash(
"description": description,
"backtrace": summary,
});
- SnowflakeRow::new(
+ let row = SnowflakeRow::new(
"Crash Reported",
None,
false,
Some(installation_id),
properties,
- )
- .write(&Some(kinesis_client), &Some(stream))
- .await
- .log_err();
+ );
+ let data = serde_json::to_vec(&row)?;
+ kinesis_client
+ .put_record()
+ .stream_name(stream)
+ .partition_key(row.insert_id.unwrap_or_default())
+ .data(data.into())
+ .send()
+ .await
+ .log_err();
}
}
@@ -364,16 +370,22 @@ pub async fn post_panic(
"description": panic.payload,
"backtrace": backtrace,
});
- SnowflakeRow::new(
+ let row = SnowflakeRow::new(
"Panic Reported",
None,
false,
panic.installation_id.clone(),
properties,
- )
- .write(&Some(kinesis_client), &Some(stream))
- .await
- .log_err();
+ );
+ let data = serde_json::to_vec(&row)?;
+ kinesis_client
+ .put_record()
+ .stream_name(stream)
+ .partition_key(row.insert_id.unwrap_or_default())
+ .data(data.into())
+ .send()
+ .await
+ .log_err();
}
}