feat: Remove get-auth-chain command

It's not really useful to just know how long loading an auth chain took
This commit is contained in:
timedout committed 2026-10-31 23:12:43 +00:00
1 parent 2f82475811
commit a535604a27
2 files changed
-35

No files matched your search

-29
View File
@@ -82,35 +82,6 @@ impl crate::Context<'_> {
self.write_str(&message).await
}
pub(super) async fn get_auth_chain(&self, event_id: OwnedEventId) -> Result {
let Ok(event) = self.services.rooms.timeline.get_pdu_json(&event_id).await else {
return Err!("Event not found.");
};
let room_id_str = event
.get("room_id")
.and_then(CanonicalJsonValue::as_str)
.ok_or_else(|| err!(Database("Invalid event in database")))?;
let room_id = <&RoomId>::try_from(room_id_str)
.map_err(|_| err!(Database("Invalid room id field in event in database")))?;
let start = Instant::now();
let count = self
.services
.rooms
.auth_chain
.event_ids_iter(room_id, once(event_id.as_ref()))
.ready_filter_map(Result::ok)
.count()
.await;
let elapsed = start.elapsed();
let out = format!("Loaded auth chain with length {count} in {elapsed:?}");
self.write_str(&out).await
}
pub(super) async fn show_auth_chain(&self, event_id: OwnedEventId) -> Result {
let node_status = async |event_id: &EventId, missing: bool| -> NodeStatus {
if self
-6
View File
@@ -16,12 +16,6 @@ pub enum DebugCommand {
message: Vec<String>,
},
/// Loads the auth_chain of a PDU, reporting how long it took.
GetAuthChain {
/// An event ID (the $ character followed by the base64 reference hash)
event_id: OwnedEventId,
},
/// Walks & displays the auth_chain of a PDU in a mermaid graph format.
///
/// This is useless to basically anyone but developers, and is also probably