Commit 0e8b88a00ce2
tarball2 files changed+7-0
@@ -448,6 +448,9 @@ impl RoomEventCache {
448448
449449
#[doc = "Looks once behind the newest previous-batch token a non-limited sync handed out. Answers None when there was none, else how many unknown events it inserted."]450450
pub async fn probe_sync_hole(&self) -> Result<Option<usize>> {451
+ if !self.inner.state.read().await?.has_sync_hole() {452
+ return Ok(None);453
+ }451454
match self.request_history(HistoryOperation::ProbeSyncHole).await? {452455
HistoryResponse::Probe(outcome) => Ok(outcome),453456
_ => unreachable!("coordinator response matches request"),@@ -462,6 +462,10 @@ impl<'a> RoomEventCacheStateLockReadGuard<'a> {
462462
super::history::gap_positions(&self.state.room_linked_chunk)463463
}464464
465
+ pub(super) fn has_sync_hole(&self) -> bool {466
+ self.state.sync_hole.is_some()467
+ }468
+465469
/// Return the subscriber count.466470
pub fn subscriber_count(&self) -> &Arc<AtomicUsize> {467471
&self.state.subscriber_count