Redacted event retention, implement MSC2815

This commit is contained in:
dasha_uwu
2026-01-21 00:01:32 +05:00
committed by Jason Volk
parent 8000fcce9e
commit bb26b749ae
12 changed files with 244 additions and 9 deletions

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(())
}

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))]