From fbc5a6aded2b15fe4b9f42b3281b5d7daad92230 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 12 Oct 2022 15:26:10 +0100 Subject: [PATCH] Exclude memberships from complete sync when LL enabled --- syncapi/streams/stream_pdu.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/syncapi/streams/stream_pdu.go b/syncapi/streams/stream_pdu.go index 613ac434f..3b0ed8b88 100644 --- a/syncapi/streams/stream_pdu.go +++ b/syncapi/streams/stream_pdu.go @@ -81,6 +81,13 @@ func (p *PDUStreamProvider) CompleteSync( stateFilter := req.Filter.Room.State eventFilter := req.Filter.Room.Timeline + // If we're lazy-loading memberships then we can exclude those from the sync. + if req.Filter.Room.State.LazyLoadMembers { + if t := req.Filter.Room.State.NotTypes; t != nil { + *t = append(*t, gomatrixserverlib.MRoomMember) + } + } + if err = p.addIgnoredUsersToFilter(ctx, snapshot, req, &eventFilter); err != nil { req.Log.WithError(err).Error("unable to update event filter with ignored users") }