Redacted event retention, implement MSC2815

This commit is contained in:
dasha_uwu authored and Jason Volk committed 2026-01-26 19:28:56 +00:00
1 parent 8000fcce9e
commit bb26b749ae
12 files changed
+244 -9

No files matched your search

+16
View File
@@ -1023,3 +1023,19 @@ pub(super) async fn resync_database(&self) -> Result {
.update()
.map_err(|e| err!("Failed to update from primary: {e:?}"))
}
#[admin_command]
pub(super) async fn get_retained_pdu(&self, event_id: OwnedEventId) -> Result {
let pdu = self
.services
.retention
.get_original_pdu_json(&event_id)
.await?;
let text = serde_json::to_string_pretty(&pdu)?;
self.write_str(&format!("Original PDU:\n```json\n{text}```"))
.await?;
Ok(())
}
+5
View File
@@ -250,6 +250,11 @@ pub(super) enum DebugCommand {
/// - Synchronize database with primary (secondary only)
ResyncDatabase,
/// - Retrieves the saved original PDU before it has been redacted
GetRetainedPdu {
event_id: OwnedEventId,
},
/// - Developer test stubs
#[command(subcommand)]
#[clap(hide(true))]