From 07066e1c1f95c3ff4e4ea6d9e253dbd8bbed2a00 Mon Sep 17 00:00:00 2001 From: Julian Sparber Date: Mon, 28 Mar 2022 15:50:48 +0200 Subject: [PATCH] store: Make sure that event position in store is contiguous This fixes the breaking gap in the timeline when reading the events from store. --- crates/matrix-sdk-indexeddb/src/state_store.rs | 2 +- crates/matrix-sdk-sled/src/state_store.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/matrix-sdk-indexeddb/src/state_store.rs b/crates/matrix-sdk-indexeddb/src/state_store.rs index 745ceb971..1ad3ad3a0 100644 --- a/crates/matrix-sdk-indexeddb/src/state_store.rs +++ b/crates/matrix-sdk-indexeddb/src/state_store.rs @@ -616,7 +616,7 @@ impl IndexeddbStore { TimelineMetadata { start: timeline.start.clone(), end: timeline.end.clone(), - start_position: usize::MAX / 2, + start_position: usize::MAX / 2 + 1, end_position: usize::MAX / 2, } }; diff --git a/crates/matrix-sdk-sled/src/state_store.rs b/crates/matrix-sdk-sled/src/state_store.rs index 536b6a573..098e04d71 100644 --- a/crates/matrix-sdk-sled/src/state_store.rs +++ b/crates/matrix-sdk-sled/src/state_store.rs @@ -1211,7 +1211,7 @@ impl SledStore { TimelineMetadata { start: timeline.start.clone(), end: timeline.end.clone(), - start_position: usize::MAX / 2, + start_position: usize::MAX / 2 + 1, end_position: usize::MAX / 2, } };