Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix exceptions when handling incoming transactions #3968

Merged
merged 6 commits into from
Oct 1, 2018

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Sep 26, 2018

Fixes a number of problems in on_receive_pdu - in particular #3923 and #3934. Suggest looking at the commits for more information.

This PR builds on #3967 and #3959.

richvdh added a commit to matrix-org/sytest that referenced this pull request Sep 26, 2018
This tries to test the things that are fixed in
matrix-org/synapse#3968.
get_state_groups returns a map from state_group_id to a list of FrozenEvents,
so was very much the wrong thing to be putting as one of the entries in the
list passed to resolve_events_with_factory (which expects maps from
(event_type, state_key) to event id).

We actually want get_state_groups_ids().values() rather than
get_state_groups().

This fixes the main problem in #3923, but there are other problems with this
bit of code which get discovered once you do so.
If we've fetched state events from remote servers in order to resolve the state
for a new event, we need to actually pass those events into
resolve_events_with_factory (so that it can do the state res) and then persist
the ones we need - otherwise other bits of the codebase get confused about why
we have state groups pointing to non-existent events.
If we have a forward extremity for a room as `E`, and you receive `A`, `B`,
s.t. `A -> B -> E`, and `B` also points to an unknown event `X`, then we need
to do state res between `X` and `E`.

When that happens, we need to make sure we include `X` in the state that goes
into the state res alg.

Fixes #3934.
@richvdh richvdh force-pushed the rav/fix_federation_errors branch from 76fef8d to 948a6d8 Compare September 27, 2018 10:37
richvdh added a commit to matrix-org/sytest that referenced this pull request Sep 27, 2018
This tries to test the things that are fixed in
matrix-org/synapse#3968.
This test didn't do what it claimed to do, and what it claimed to do was the
same as test_cant_hide_direct_ancestors anyway.

This stuff is tested by sytest anyway.
@richvdh richvdh force-pushed the rav/fix_federation_errors branch from 484a9b8 to 5127c15 Compare September 27, 2018 14:17
@richvdh richvdh force-pushed the rav/fix_federation_errors branch from 5127c15 to f094f71 Compare September 27, 2018 14:18
@richvdh richvdh requested a review from a team September 27, 2018 14:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants