feat(event cache): add a feature toggle to enable automatic back-pagination
This commit is contained in:
@@ -2104,6 +2104,15 @@ impl Client {
|
||||
}
|
||||
}))))
|
||||
}
|
||||
|
||||
/// Whether to enable automatic backpagination under certain conditions
|
||||
/// (e.g. when processing read receipts).
|
||||
///
|
||||
/// This is an experimental feature, and might cause performance issues on
|
||||
/// large accounts. Use with caution.
|
||||
pub async fn enable_automatic_backpagination(&self) {
|
||||
self.inner.event_cache().config_mut().await.experimental_auto_backpagination = true;
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "experimental-element-recent-emojis")]
|
||||
|
||||
@@ -379,6 +379,11 @@ pub struct EventCacheConfig {
|
||||
|
||||
/// Maximum number of pinned events to load, for any room.
|
||||
pub max_pinned_events_to_load: usize,
|
||||
|
||||
/// Whether to automatically backpaginate a room under certain conditions.
|
||||
///
|
||||
/// Off by default.
|
||||
pub experimental_auto_backpagination: bool,
|
||||
}
|
||||
|
||||
impl EventCacheConfig {
|
||||
@@ -395,6 +400,7 @@ impl Default for EventCacheConfig {
|
||||
Self {
|
||||
max_pinned_events_concurrent_requests: Self::DEFAULT_MAX_CONCURRENT_REQUESTS,
|
||||
max_pinned_events_to_load: Self::DEFAULT_MAX_EVENTS_TO_LOAD,
|
||||
experimental_auto_backpagination: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user