diff options
author | Richard van der Hoff <github@rvanderhoff.org.uk> | 2017-03-20 11:21:01 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-20 11:21:01 +0000 |
commit | 2e05f5d7a4d713be3ba950672c26e6d5e3ab031f (patch) | |
tree | 9beddc25115cb9931933727b1ea6d7205999ce72 /synapse/storage/event_federation.py | |
parent | Merge pull request #2016 from matrix-org/rav/queue_pdus_during_join (diff) | |
parent | Avoid resetting state on rejected events (diff) | |
download | synapse-2e05f5d7a4d713be3ba950672c26e6d5e3ab031f.tar.xz |
Merge pull request #2025 from matrix-org/rav/no_reset_state_on_rejections
Avoid resetting state on rejected events
Diffstat (limited to 'synapse/storage/event_federation.py')
-rw-r--r-- | synapse/storage/event_federation.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/synapse/storage/event_federation.py b/synapse/storage/event_federation.py index 256e50dc20..0d97de2fe7 100644 --- a/synapse/storage/event_federation.py +++ b/synapse/storage/event_federation.py @@ -201,19 +201,19 @@ class EventFederationStore(SQLBaseStore): def _update_min_depth_for_room_txn(self, txn, room_id, depth): min_depth = self._get_min_depth_interaction(txn, room_id) - do_insert = depth < min_depth if min_depth else True + if min_depth and depth >= min_depth: + return - if do_insert: - self._simple_upsert_txn( - txn, - table="room_depth", - keyvalues={ - "room_id": room_id, - }, - values={ - "min_depth": depth, - }, - ) + self._simple_upsert_txn( + txn, + table="room_depth", + keyvalues={ + "room_id": room_id, + }, + values={ + "min_depth": depth, + }, + ) def _handle_mult_prev_events(self, txn, events): """ |