store: Add comment why we can ignore unexpected TimelineSlices
This commit is contained in:
@@ -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(());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user