-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(sdk): Remove RoomEventCacheUpdate::Clear
#4627
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4627 +/- ##
==========================================
- Coverage 85.70% 85.69% -0.02%
==========================================
Files 292 292
Lines 33406 33409 +3
==========================================
- Hits 28632 28630 -2
- Misses 4774 4779 +5 ☔ View full report in Codecov by Sentry. |
9476b3f
to
e467f1e
Compare
This patch removes the `Clear` variant of the `RoomEventCacheUpdate` enum. This one is not needed anymore since we have `UpdateTimelineEvents` which contains updates as `Vec<VectorDiff<_>>`. `VectorDiff` _has_ a `Clear` variant. It resulted in a double clear every time. This patch updates `RoomEventCacheInner::reset` and `RoomEventCacheInner::with_events_mut` to annotate them with a `#[must_use]`. Since they return the updates as `VectorDiff`s, they **must** be broadcasted/propagated somewhere, likely with `RoomEventCacheUpdate`. This mechanism ensures to not miss updates.
e467f1e
to
55b6c1a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me, looks good! 👍
This patch removes the
Clear
variant of theRoomEventCacheUpdate
enum. This one is not needed anymore since we haveUpdateTimelineEvents
which contains updates asVec<VectorDiff<_>>
.VectorDiff
has aClear
variant. It resulted in a double clear every time.This patch updates
RoomEventCacheInner::reset
andRoomEventCacheInner::with_events_mut
to annotate them with a#[must_use]
. Since they return the updates asVectorDiff
s, they must be broadcasted/propagated somewhere, likely withRoomEventCacheUpdate
. This mechanism ensures to not miss updates.EventCache
storage #3280