Skip to content

Revert "Fix /sync missing membership in state_after"#19474

Merged
sandhose merged 1 commit intodevelopfrom
revert-19463-madlittlemods/19455-fix-state-after-missing-membership
Feb 17, 2026
Merged

Revert "Fix /sync missing membership in state_after"#19474
sandhose merged 1 commit intodevelopfrom
revert-19463-madlittlemods/19455-fix-state-after-missing-membership

Conversation

@sandhose
Copy link
Copy Markdown
Member

@sandhose sandhose commented Feb 17, 2026

Reverts #19463

The complement tests haven't been reviewed and require more testing. Discussed in the internal backend team lobby room.

@sandhose sandhose requested a review from a team as a code owner February 17, 2026 16:39
@sandhose sandhose merged commit bd0756c into develop Feb 17, 2026
32 of 35 checks passed
@sandhose sandhose deleted the revert-19463-madlittlemods/19455-fix-state-after-missing-membership branch February 17, 2026 16:41
@@ -1041,18 +1041,9 @@ async def compute_state_delta(
if event.sender not in first_event_by_sender_map:
Copy link
Copy Markdown
Contributor

@MadLittleMods MadLittleMods Feb 17, 2026

Choose a reason for hiding this comment

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

To better explain, "Why the revert?"

While #19463 still seems sane, the PR that enables the Complement tests is failing in CI, #19460 - These tests pass just fine locally and just require some time to figure out why CI isn't as happy as we are. Additionally, @dbkr even tried it out end-to-end with Element and confirmed it fixes the problem originally reported.

The RC process is underway and we don't want to block it trying to figure out the CI. Easier to revert and re-introduce again.

Additionally, the Complement tests weren't reviewed before #19463 was merged so even if the CI was passing there, merging would mean no new tests would be actually run.

In terms of what to do better next time:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fix being re-introduced in #19460

sandhose pushed a commit that referenced this pull request Mar 3, 2026
*This PR was originally only to enable
[MSC4222](matrix-org/matrix-spec-proposals#4222)
Complement tests (`/sync` `state_after`) but after merging the [fix
PR](#19463), we discovered
that while the tests pass locally, [fail in
CI](#19460 (comment)).
To unblock the RC, we decided to revert the fix PR (see
#19474 (comment)
for more info). To better ensure tests actually pass in CI, we're
re-introducing the fix here in the same PR that we enable the tests in.*

---

Fix `/sync` missing membership in `state_after`.

This applies to any scenario where the first membership has a different
`sender` compared to the `state_key` and then the second membership has
the same `sender`/`state_key`. Like someone inviting another person and
then them joining. Or someone being kicked and then they leave.

This bug has been present since the MSC4222 implementation was
introduced into the codebase
(#17888).

---

Fix #19455
Fix element-hq/customer-success#656

I have a feeling, this might also fix these issues (will close and see
how people report back):

Fix #18182
Fix #19478

 ### Testing strategy

Complement tests: matrix-org/complement#842

We will need #19460 to merge
in order to enable the Complement tests in Synapse but this PR should be
merged first so they pass in the first place. I've tested locally that
the Complement tests pass with this fix.




### Dev notes


[MSC4222](matrix-org/matrix-spec-proposals#4222)
has already been merged into the spec and is already part of Matrix
v1.16 but we haven't [stabilized support in Synapse
yet](#19414).

---

In the same ballpark:

 - #19455
 - #17050
 - #17430
 - #16940
 - #18182
 - #18793
 - #19478

---

Docker builds preferring remote image over the local image we just
built,
#19460 (comment)

`containerd` image store (storage driver, driver type)

-> #19475


### Todo

- [x] Wait for #19463 to merge
so the Complement tests all pass
- [x] Wait for #19475 to merge

### Pull Request Checklist

<!-- Please read
https://element-hq.github.io/synapse/latest/development/contributing_guide.html
before submitting your pull request -->

* [x] Pull request is based on the develop branch
* [x] Pull request includes a [changelog
file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog).
The entry should:
- Be a short description of your change which makes sense to users.
"Fixed a bug that prevented receiving messages from other servers."
instead of "Moved X method from `EventStore` to `EventWorkerStore`.".
  - Use markdown where necessary, mostly for `code blocks`.
  - End with either a period (.) or an exclamation mark (!).
  - Start with a capital letter.
- Feel free to credit yourself, by adding a sentence "Contributed by
@github_username." or "Contributed by [Your Name]." to the end of the
entry.
* [x] [Code
style](https://element-hq.github.io/synapse/latest/code_style.html) is
correct (run the
[linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))

---------

Co-authored-by: Andrew Morgan <[email protected]>
Co-authored-by: Andrew Ferrazzutti <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants