Skip to content

Commit bd0756c

Browse files
authored
Revert "Fix /sync missing membership in state_after" (#19474)
Reverts #19463 The complement tests haven't been reviewed and require more testing. Discussed in the internal [backend team lobby](https://matrix.to/#/!SGNQGPGUwtcPBUotTL:matrix.org/$XDARK2u2iLL5wWaxiL6tJYkLg80Sn6yWWEQib8ahl5Q?via=jki.re&via=element.io&via=matrix.org) room.
1 parent e627b08 commit bd0756c

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

changelog.d/19463.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

synapse/handlers/sync.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,18 +1041,9 @@ async def compute_state_delta(
10411041
if event.sender not in first_event_by_sender_map:
10421042
first_event_by_sender_map[event.sender] = event
10431043

1044-
# When using `state_after`, there is no special treatment with
1045-
# regards to state also being in the `timeline`. Always fetch
1046-
# relevant membership regardless of whether the state event is in
1047-
# the `timeline`.
1048-
if sync_config.use_state_after:
1049-
members_to_fetch.add(event.sender)
1050-
# For `state`, the client is supposed to do a flawed re-construction
1051-
# of state over time by starting with the given `state` and layering
1052-
# on state from the `timeline` as you go (flawed because state
1053-
# resolution). In this case, we only need their membership in
1054-
# `state` when their membership isn't already in the `timeline`.
1055-
elif (EventTypes.Member, event.sender) not in timeline_state:
1044+
# We need the event's sender, unless their membership was in a
1045+
# previous timeline event.
1046+
if (EventTypes.Member, event.sender) not in timeline_state:
10561047
members_to_fetch.add(event.sender)
10571048
# FIXME: we also care about invite targets etc.
10581049

0 commit comments

Comments
 (0)