0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-12-15 21:13:43 +01:00

Don't dedupe before applying the history vis filter

This commit is contained in:
Neil Alexander 2022-08-16 13:37:24 +01:00
parent 5819b4a7ce
commit d27c4a0874
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -498,7 +498,6 @@ func (p *PDUStreamProvider) getJoinResponseForCompleteSync(
// transaction IDs for complete syncs, but we do it anyway because Sytest demands it for:
// "Can sync a room with a message with a transaction id" - which does a complete sync to check.
recentEvents := p.DB.StreamEventsToEvents(device, recentStreamEvents)
stateEvents = removeDuplicates(stateEvents, recentEvents)
events := recentEvents
// Only apply history visibility checks if the response is for joined rooms
@ -509,6 +508,8 @@ func (p *PDUStreamProvider) getJoinResponseForCompleteSync(
}
}
stateEvents = removeDuplicates(stateEvents, recentEvents)
// 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)