diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2018-07-24 14:11:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-24 14:11:45 +0100 |
commit | a321f78991b0d9b4f410b111a9e005c289ec8302 (patch) | |
tree | 0c346f8b30059af3764978fd073dcd48d2027ed7 /synapse/handlers/federation.py | |
parent | Merge pull request #3583 from matrix-org/rav/remove_who_forgot_in_room (diff) | |
parent | Handle delta_ids being None in _update_context_for_auth_events (diff) | |
download | synapse-a321f78991b0d9b4f410b111a9e005c289ec8302.tar.xz |
Merge pull request #3586 from matrix-org/rav/optimise_resolve_state_groups
Fixes and optimisations for resolve_state_groups
Diffstat (limited to 'synapse/handlers/federation.py')
-rw-r--r-- | synapse/handlers/federation.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index 14654d59f1..145c1a21d4 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -1980,10 +1980,6 @@ class FederationHandler(BaseHandler): current_state_ids.update(state_updates) - if context.delta_ids is not None: - delta_ids = dict(context.delta_ids) - delta_ids.update(state_updates) - prev_state_ids = yield context.get_prev_state_ids(self.store) prev_state_ids = dict(prev_state_ids) @@ -1991,11 +1987,13 @@ class FederationHandler(BaseHandler): k: a.event_id for k, a in iteritems(auth_events) }) + # create a new state group as a delta from the existing one. + prev_group = context.state_group state_group = yield self.store.store_state_group( event.event_id, event.room_id, - prev_group=context.prev_group, - delta_ids=delta_ids, + prev_group=prev_group, + delta_ids=state_updates, current_state_ids=current_state_ids, ) @@ -2003,7 +2001,8 @@ class FederationHandler(BaseHandler): state_group=state_group, current_state_ids=current_state_ids, prev_state_ids=prev_state_ids, - delta_ids=delta_ids, + prev_group=prev_group, + delta_ids=state_updates, ) @defer.inlineCallbacks |