mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-13 12:16:54 +00:00
feat: Keep track of a min_depth value
Should prevent weird situations where we accidentally gapfill into backfill territory
This commit is contained in:
8 files changed
+65
-41
No files matched your search
@@ -22,7 +22,7 @@ use futures::{FutureExt, StreamExt, TryStreamExt};
|
||||
use lettre::message::Mailbox;
|
||||
use ruma::{
|
||||
CanonicalJsonObject, CanonicalJsonValue, EventId, OwnedEventId, OwnedRoomId,
|
||||
OwnedRoomOrAliasId, OwnedServerName, RoomId, RoomVersionId, ServerName, UInt,
|
||||
OwnedRoomOrAliasId, OwnedServerName, RoomId, RoomVersionId, UInt,
|
||||
api::federation::event::get_room_state, events::AnyStateEvent, serde::Raw,
|
||||
};
|
||||
use service::rooms::{
|
||||
@@ -1138,32 +1138,3 @@ pub(super) async fn send_test_email(&self) -> Result {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[admin_command]
|
||||
pub(super) async fn walk_missing_events(
|
||||
&self,
|
||||
latest: OwnedEventId,
|
||||
earliest: OwnedEventId,
|
||||
via: String,
|
||||
) -> Result {
|
||||
let latest_pdu = self.services.rooms.timeline.get_pdu(&latest).await?;
|
||||
let events = self
|
||||
.services
|
||||
.rooms
|
||||
.event_handler
|
||||
.get_missing_events(
|
||||
&latest_pdu.room_id_or_hash(),
|
||||
&latest_pdu,
|
||||
vec![earliest],
|
||||
&ServerName::parse(via)?,
|
||||
)
|
||||
.await?;
|
||||
self.write_str(&format!("Found {} events:\n\n```\n", events.len()))
|
||||
.await?;
|
||||
for (event_id, event) in events {
|
||||
self.write_str(&format!("{event_id}: {:?}\n\n", serde_json::to_string(&event)))
|
||||
.await?;
|
||||
}
|
||||
self.write_str("\n```").await?;
|
||||
Ok(())
|
||||
}
|
||||
@@ -32,12 +32,6 @@ pub enum DebugCommand {
|
||||
event_id: OwnedEventId,
|
||||
},
|
||||
|
||||
WalkMissingEvents {
|
||||
latest: OwnedEventId,
|
||||
earliest: OwnedEventId,
|
||||
via: String,
|
||||
},
|
||||
|
||||
/// Parse and print a PDU from a JSON
|
||||
///
|
||||
/// The PDU event is only checked for validity and is not added to the
|
||||
|
||||
Reference in new issue
Block a user