diff --git a/crates/matrix-sdk/src/sliding_sync.rs b/crates/matrix-sdk/src/sliding_sync.rs index 226d46620..0f526b118 100644 --- a/crates/matrix-sdk/src/sliding_sync.rs +++ b/crates/matrix-sdk/src/sliding_sync.rs @@ -1419,7 +1419,9 @@ impl SlidingSyncView { )); } - while pos < end { + // ranges are inclusive up to the last index. e.g. `[0, 10]`; `[0, 0]`. + // ensure we pick them all up + while pos <= end { if pos as usize >= max_len { break; // how does this happen? }