Skip to content

Fix a bug which could corrupt auth chains#18746

Merged
kegsay merged 3 commits into
developfrom
kegan/corrupt-auth-chains
Aug 15, 2025
Merged

Fix a bug which could corrupt auth chains#18746
kegsay merged 3 commits into
developfrom
kegan/corrupt-auth-chains

Conversation

@kegsay
Copy link
Copy Markdown
Contributor

@kegsay kegsay commented Jul 29, 2025

Complement tests

Basically, when we use /state_ids in conjunction with /event requests, the /event request can fail causing a partial state to be returned. When we persist the state, we process dependent events first. If we fail to process a dependent event due to missing the auth_event, we didn't update the in-memory event map. This meant that we could incorrectly persist events that depended on dropped events.

Discovered via Chaos testing.

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. 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.
  • Code style is correct (run the linters)

Comment thread synapse/handlers/federation_event.py
@kegsay kegsay merged commit 76c9f09 into develop Aug 15, 2025
103 of 112 checks passed
@kegsay kegsay deleted the kegan/corrupt-auth-chains branch August 15, 2025 09:15
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.

3 participants