This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Fix bug which caused rejected events to be stored with the wrong room state #6320
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem here was the code in
StateStore
which assumed thatprev_group
gave the state before the event being persisted. Whilst this may (sometimes) have been true for state events, it was never true for message events.I'm not entirely sure if this is the best way to fix it, but the general idea is to rewrite
compute_event_context
to ensure that we always have a state group for the state before the event being persisted (and to store it in a new field in theEventContext
). That also allows us to rewrite it to reduce a bunch of duplication between the code paths.Fixes #6289.
This PR builds on #6319.