Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/19463.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix `/sync` missing membership event in `state_after` (experimental [MSC4222](https://github.com/matrix-org/matrix-spec-proposals/pull/4222) implementation) in some scenarios.
Copy link
Copy Markdown
Contributor Author

@MadLittleMods MadLittleMods Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the odds of this making the next Synapse release on the 24th?

-- @dbkr, #19463 (comment)

Low based on current review rate. Would need review today in order to make the RC tomorrow (204-02-17) and then the full release on 2026-02-24.

I also don't want to rush anyone as although I think this is a sane change, could introduce a new problem that the maintainer has to then spend even more effort to put out a new RC about. Feel free to make your case in the backend team lobby room and someone may be sympathetic enough to review.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turned into some trouble: #19474 (comment)

(only because of CI though)

15 changes: 12 additions & 3 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,9 +1041,18 @@ async def compute_state_delta(
if event.sender not in first_event_by_sender_map:
first_event_by_sender_map[event.sender] = event

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

Expand Down