Skip to main content

Module event_handler

Module event_handler 

Source
Expand description

Incoming event handling, from the first signature check to the timeline.

The service authorizes incoming PDUs, fetches the events they depend on, derives their state and appends them. Observability counters cover the local state build, the previous-event walk and the backoff verdicts. A per-room history keeps the previous-event walk passes for up to three days.

Re-exportsΒ§

use std::fmt::Write; πŸ”’
use std::num::NonZeroUsize; πŸ”’
use std::sync::Arc; πŸ”’
use async_trait::async_trait; πŸ”’
use ruma::EventId; πŸ”’
use ruma::OwnedRoomId; πŸ”’
use ruma::RoomVersionId; πŸ”’
use ruma::events::AnyStrippedStateEvent; πŸ”’
use ruma::serde::Raw; πŸ”’
use tuwunel_core::Result; πŸ”’
use tuwunel_core::implement; πŸ”’
use tuwunel_core::utils::MutexMap; πŸ”’
use tuwunel_database::Map; πŸ”’
use tuwunel_matrix::PduEvent; πŸ”’
use self::backoff::BackoffCounters; πŸ”’
use self::prev_walk::InFlightWalks; πŸ”’
use self::prev_walk::PrevWalkCounters; πŸ”’
use self::state_local_build::StateLocalCounters; πŸ”’
pub use self::backoff::BackoffMetrics;
pub use self::backoff::Verdicts;
pub use self::policy_server::PolicyCheck;
pub use self::prev_walk::InFlightWalk;
pub use self::prev_walk::Outcome as PrevWalkOutcome;
pub use self::prev_walk::PrevWalkMetrics;
pub use self::prev_walk::PrevWalkPass;
pub use self::prev_walk::PrevWalkRoom;
pub use self::prev_walk::Walk;
pub use self::state_local_build::LocalBuildReport;
pub use self::state_local_build::StateLocalMetrics;
use crate::service::make_name; πŸ”’

ModulesΒ§

acl_check πŸ”’
backoff πŸ”’
fetch_auth πŸ”’
fetch_prev πŸ”’
fetch_state πŸ”’
handle_incoming_pdu πŸ”’
handle_outlier_pdu πŸ”’
handle_prev_pdu πŸ”’
outlier_state πŸ”’
parse_incoming_pdu πŸ”’
policy_server πŸ”’
prev_walk πŸ”’
resolve_state πŸ”’
state_at_incoming πŸ”’
state_local_build πŸ”’
upgrade_outlier_pdu πŸ”’

StructsΒ§

Data πŸ”’
Service
Handles incoming events: authorization, fetching missing events, state resolution and upgrade into the timeline.

ConstantsΒ§

EVENT_FETCH_ATTEMPT_LIMIT πŸ”’

FunctionsΒ§

room_version_of πŸ”’
Extract a room’s version from the create event in a stripped-state list (as stored for an out-of-band invite or knock).

Type AliasesΒ§

RoomMutexMap πŸ”’