diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2022-11-03 10:19:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-03 10:19:37 +0000 |
commit | 8704e84898e2a31d5cefbdb43c8d7b325f20eb51 (patch) | |
tree | c1744f5fd22c66e6cf59e515b556771e2d13bfd7 | |
parent | 1fcbb9b5e5b7791c50be437c20d73d973b2b78ee (diff) |
Tweak `removeDuplicates` calls to use `events` instead of `recentEvents` (#2853)
... since `events` is *after* history visibility filtering, not before
it.
-rw-r--r-- | syncapi/streams/stream_pdu.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/syncapi/streams/stream_pdu.go b/syncapi/streams/stream_pdu.go index 5ea2732f..5b356081 100644 --- a/syncapi/streams/stream_pdu.go +++ b/syncapi/streams/stream_pdu.go @@ -316,7 +316,7 @@ func (p *PDUStreamProvider) addRoomDeltaToResponse( // left. Anything that appears in the filtered timeline will be removed from the // "state" section and kept in "timeline". delta.StateEvents = gomatrixserverlib.HeaderedReverseTopologicalOrdering( - removeDuplicates(delta.StateEvents, recentEvents), + removeDuplicates(delta.StateEvents, events), gomatrixserverlib.TopologicalOrderByAuthEvents, ) @@ -530,7 +530,7 @@ func (p *PDUStreamProvider) getJoinResponseForCompleteSync( // If we are limited by the filter AND the history visibility filter // didn't "remove" events, return that the response is limited. limited = limited && len(events) == len(recentEvents) - stateEvents = removeDuplicates(stateEvents, recentEvents) + stateEvents = removeDuplicates(stateEvents, events) if stateFilter.LazyLoadMembers { if err != nil { return nil, err |