Skip to main content

Module backfill

Module backfill 

Source
Expand description

Retrieves older room history from federation and inserts validated events.

Candidate servers are selected from trusted and room-related origins, while remote timestamp claims are checked against the ingested event. Backfilled events receive negative stream counts so they sort before normal history.

Re-exportsยง

use std::collections::HashSet; ๐Ÿ”’
use std::iter::once; ๐Ÿ”’
use std::num::NonZeroUsize; ๐Ÿ”’
use futures::FutureExt; ๐Ÿ”’
use futures::StreamExt; ๐Ÿ”’
use futures::TryFutureExt; ๐Ÿ”’
use futures::future::join; ๐Ÿ”’
use futures::future::try_join; ๐Ÿ”’
use futures::future::try_join4; ๐Ÿ”’
use rand::seq::SliceRandom; ๐Ÿ”’
use ruma::CanonicalJsonObject; ๐Ÿ”’
use ruma::EventId; ๐Ÿ”’
use ruma::MilliSecondsSinceUnixEpoch; ๐Ÿ”’
use ruma::OwnedEventId; ๐Ÿ”’
use ruma::RoomId; ๐Ÿ”’
use ruma::ServerName; ๐Ÿ”’
use ruma::api::Direction; ๐Ÿ”’
use ruma::events::TimelineEventType; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde_json::value::RawValue as RawJsonValue; ๐Ÿ”’
use tuwunel_core::Err; ๐Ÿ”’
use tuwunel_core::Result; ๐Ÿ”’
use tuwunel_core::at; ๐Ÿ”’
use tuwunel_core::debug; ๐Ÿ”’
use tuwunel_core::debug; ๐Ÿ”’
use tuwunel_core::debug_warn; ๐Ÿ”’
use tuwunel_core::implement; ๐Ÿ”’
use tuwunel_core::is_false; ๐Ÿ”’
use tuwunel_core::utils::BoolExt; ๐Ÿ”’
use tuwunel_core::utils::IterStream; ๐Ÿ”’
use tuwunel_core::utils::ReadyExt; ๐Ÿ”’
use tuwunel_core::utils::future::BoolExt as FutureBoolExt; ๐Ÿ”’
use tuwunel_core::utils::future::TryExtExt; ๐Ÿ”’
use tuwunel_core::validated; ๐Ÿ”’
use tuwunel_core::warn; ๐Ÿ”’
use tuwunel_database::Json; ๐Ÿ”’
use tuwunel_matrix::PduEvent; ๐Ÿ”’
use tuwunel_matrix::event::Event; ๐Ÿ”’
use tuwunel_matrix::pdu::PduCount; ๐Ÿ”’
use tuwunel_matrix::pdu::PduId; ๐Ÿ”’
use tuwunel_matrix::pdu::RawPduId; ๐Ÿ”’
use super::ExtractBody; ๐Ÿ”’
use super::bias_count; ๐Ÿ”’
use crate::federation::Candidates; ๐Ÿ”’
use crate::fetcher::Op; ๐Ÿ”’
use crate::fetcher::Opts; ๐Ÿ”’
use crate::rooms::state_accessor::plain_text_topic; ๐Ÿ”’

Structsยง

TimestampHit ๐Ÿ”’
The event_id and timestamp parsed back out of an Op::TimestampToEvent fetch outcome.

Constantsยง

BACKFILL_ATTEMPT_LIMIT ๐Ÿ”’
BACKFILL_BATCH_ATTEMPTS ๐Ÿ”’
BACKFILL_LIMIT ๐Ÿ”’
Events requested per backfill batch.

Functionsยง

nearer ๐Ÿ”’