Skip to content

Commit

Permalink
fixup! optimize incremental sync state diff
Browse files Browse the repository at this point in the history
  • Loading branch information
jevolk committed Feb 2, 2025
1 parent 86adf9e commit 4bd3172
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/api/client/sync/v3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,11 @@ async fn calculate_state_incremental<'a>(
.flatten_stream()
.flatten();

let sender_member_id = state_get_shorteventid(sender_user)
.map(Option::into_iter)
.map(IterStream::stream)
.flatten_stream();

let state_events = current_state_ids
.map(|opt| opt.map(at!(1)))
.map(Option::into_iter)
Expand All @@ -1040,6 +1045,7 @@ async fn calculate_state_incremental<'a>(
.flatten()
.chain(state_diff_ids)
.chain(lazy_state_ids)
.chain(sender_member_id)
.collect::<Vec<_>>()
.map(|mut vec| {
vec.sort_unstable();
Expand Down

0 comments on commit 4bd3172

Please sign in to comment.