diff --git a/syncapi/streams/stream_pdu.go b/syncapi/streams/stream_pdu.go index 90f401481..b191f482b 100644 --- a/syncapi/streams/stream_pdu.go +++ b/syncapi/streams/stream_pdu.go @@ -315,10 +315,17 @@ func (p *PDUStreamProvider) addRoomDeltaToResponse( // Now that we've filtered the timeline, work out which state events are still // 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), - gomatrixserverlib.TopologicalOrderByAuthEvents, - ) + + // Don't remove the state events if this is a newly joined room. The member + // needs the full room state. For example, to figure out if the room is a space + // or not, it needs the m.room.create event which may be chronologically outside + // the filter limit. + if !delta.NewlyJoined { + delta.StateEvents = gomatrixserverlib.HeaderedReverseTopologicalOrdering( + removeDuplicates(delta.StateEvents, recentEvents), + gomatrixserverlib.TopologicalOrderByAuthEvents, + ) + } if len(delta.StateEvents) > 0 { updateLatestPosition(delta.StateEvents[len(delta.StateEvents)-1].EventID()) diff --git a/sytest-blacklist b/sytest-blacklist index e2859dcb6..daa4c0442 100644 --- a/sytest-blacklist +++ b/sytest-blacklist @@ -46,3 +46,8 @@ If a device list update goes missing, the server resyncs on the next one # Might be a bug in the test because leaves do appear :-( Leaves are present in non-gapped incremental syncs + +# Fails due to fix / workaround for this issue https://github.com/matrix-org/dendrite/issues/2842 + +Newly joined room is included in an incremental sync +Newly joined room is included in an incremental sync after invite \ No newline at end of file diff --git a/sytest-whitelist b/sytest-whitelist index 28235b772..c9cffb07c 100644 --- a/sytest-whitelist +++ b/sytest-whitelist @@ -106,7 +106,6 @@ Can download filter Lazy loading parameters in the filter are strictly boolean Can sync Can sync a joined room -Newly joined room is included in an incremental sync User is offline if they set_presence=offline in their sync Changes to state are included in an incremental sync A change to displayname should appear in incremental /sync @@ -224,7 +223,6 @@ Can't deactivate account with wrong password After deactivating account, can't log in with password After deactivating account, can't log in with an email Remote room alias queries can handle Unicode -Newly joined room is included in an incremental sync after invite Inbound /v1/make_join rejects remote attempts to join local users to rooms Local room members see posted message events Fetching eventstream a second time doesn't yield the message again