store: Add comment why we can ignore unexpected TimelineSlices

This commit is contained in:
Julian Sparber
2022-02-22 16:49:42 +01:00
parent 70e826ff25
commit 3378d18ca8
3 changed files with 9 additions and 0 deletions
@@ -525,6 +525,9 @@ impl IndexeddbStore {
.transpose()?;
if let Some(mut metadata) = metadata {
if !timeline.sync && Some(&timeline.start) != metadata.end.as_ref() {
// This should only happen when a developer adds a wrong timeline
// batch to the `StateChanges` or the server returns a wrong response
// to our request.
warn!("Drop unexpected timeline batch for {}", room_id);
return Ok(());
}
@@ -290,6 +290,9 @@ impl MemoryStore {
None
} else if let Some(mut data) = self.room_timeline.get_mut(room) {
if !timeline.sync && Some(&timeline.start) != data.end.as_ref() {
// This should only happen when a developer adds a wrong timeline
// batch to the `StateChanges` or the server returns a wrong response
// to our request.
warn!("Drop unexpected timeline batch for {}", room);
return Ok(());
}
@@ -1093,6 +1093,9 @@ impl SledStore {
.transpose()?;
if let Some(mut metadata) = metadata {
if !timeline.sync && Some(&timeline.start) != metadata.end.as_ref() {
// This should only happen when a developer adds a wrong timeline
// batch to the `StateChanges` or the server returns a wrong response
// to our request.
warn!("Drop unexpected timeline batch for {}", room_id);
return Ok(());
}