-
Notifications
You must be signed in to change notification settings - Fork 256
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
feat(sdk): Improve RoomEventCacheUpdate
#3471
feat(sdk): Improve RoomEventCacheUpdate
#3471
Conversation
This patch renames `RoomEventCacheUpdate::UpdateReadMarker` to `ReadMarker`. The `Update` prefix is already part of the enum name.
…ve_to`. This patch renames `RoomEventCacheUpdate::ReadMarker::event_id` to `ReadMarker::move_to` as I feel like it conveys a better semantics.
This patch extracts `RoomEventCacheUpdate::Append::ambiguity_changes` into a new variant `RoomEventCacheUpdate::Members { ambiguity_changes } `. This patch also creates a new private `RoomEventCacheInner::send_grouped_updates_for_events` method to ensure the updates are sent in a particular order.
This patch renames `RoomEventCacheUpdate::Append` to `SyncEvents`. The field `events` is renamed `timeline`. This patch also renames some variables to clarify the code and to match the renamings in `RoomEventCacheUpdate`.
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.
Sorry, I think most of these renamings lower clarity, introduce confusion and/or break preexisting conventions around the event cache. I'm fine with SyncEvents
, but the rest should be re-discussed and made consistent, at the very least.
This patch renames `ReadMarker { move_to: … }` to `MoveReaderMarkerTo { event_id: … }`. This patch also renames `Members` to `UpdateMembers`. Finally, this patch renames some other variables to avoid clashes with terminology in `matrix_sdk_ui`.
This patch splits `RoomEventCacheUpdate::SyncEvents` into 2 new variants: `AddTimelineEvents` and `AddEphemeralEvents`. This patch takes this opportunity to update `matrix_sdk_ui::timeline` a little bit too. `handle_sync_events` is renamed `handle_ephemeral_events`, and the `SyncTimelineEvent` argument is removed: it's possible to use `add_events_at` directly to handle the `SyncTimelineEvent`s.
This patch prevents sending useless `RoomEventCacheUdpate` if their respective values are empty.
b5ccc54
to
3b1b893
Compare
Signed-off-by: Benjamin Bouvier <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3471 +/- ##
==========================================
- Coverage 83.29% 83.29% -0.01%
==========================================
Files 248 248
Lines 25236 25245 +9
==========================================
+ Hits 21021 21028 +7
- Misses 4215 4217 +2 ☔ View full report in Codecov by Sentry. |
This patch improves/refactors
RoomEventCacheUpdate
a little bit. That's preliminary work to supportVectorDiff
from theEventCache
into theTimeline
.EventCache
storage #3280