Skip to content

Commit a58a74e

Browse files
committed
feat(sdk): LatestEventValue::None overwrites previous value.
This patch removes an optimisation that was considering `LatestEventValue::None` as a value that should no overwrite the previous value if any. This is a mistake: if the event cache is cleared, it won't be possible to calculate a new value, and the previous value must be overwritten.
1 parent 1c549a3 commit a58a74e

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

crates/matrix-sdk/src/latest_events/latest_event.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,7 @@ impl LatestEvent {
8181
)
8282
.await;
8383

84-
if let LatestEventValue::None = new_value {
85-
// The new value is `None`. It means no new value has been
86-
// computed. Let's keep the old value.
87-
} else {
88-
self.value.set(new_value).await;
89-
}
84+
self.value.set(new_value).await;
9085
}
9186
}
9287

0 commit comments

Comments
 (0)