From d0ff1891668feb11fdab9e57f42607011ff2935d Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 22 Nov 2022 12:05:13 +0000 Subject: [PATCH] Never filter out a user's own membership when using LL This isn't normally a problem as generally the user will have just joined the room and so will get included. However, if rooms are being imported then we might send down the "new" room without including the user's join event, confusing clients. --- syncapi/streams/stream_pdu.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syncapi/streams/stream_pdu.go b/syncapi/streams/stream_pdu.go index 65ca8e2a3..dd7845574 100644 --- a/syncapi/streams/stream_pdu.go +++ b/syncapi/streams/stream_pdu.go @@ -588,7 +588,7 @@ func (p *PDUStreamProvider) lazyLoadMembers( isGappedIncremental := limited && incremental // We want this users membership event, keep it in the list stateKey := *event.StateKey() - if _, ok := timelineUsers[stateKey]; ok || isGappedIncremental { + if _, ok := timelineUsers[stateKey]; ok || isGappedIncremental || stateKey == device.UserID { newStateEvents = append(newStateEvents, event) if !stateFilter.IncludeRedundantMembers { p.lazyLoadCache.StoreLazyLoadedUser(device, roomID, stateKey, event.EventID())