diff options
author | Richard van der Hoff <richard@matrix.org> | 2020-05-06 11:58:31 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2020-05-06 11:58:31 +0100 |
commit | 2e0c46ca07564d9592e5ec7d260e40c0659daa80 (patch) | |
tree | 598b91e8ee09902969038d9e1616471a7108adfe /synapse/events/snapshot.py | |
parent | Merge pull request #7429 from matrix-org/rav/upsert_for_device_list (diff) | |
parent | Move logs about discarded RDATA to debug (#7421) (diff) | |
download | synapse-2e0c46ca07564d9592e5ec7d260e40c0659daa80.tar.xz |
Merge branch 'release-v1.13.0' into develop
Diffstat (limited to 'synapse/events/snapshot.py')
-rw-r--r-- | synapse/events/snapshot.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/events/snapshot.py b/synapse/events/snapshot.py index 9ea85e93e6..7c5f620d09 100644 --- a/synapse/events/snapshot.py +++ b/synapse/events/snapshot.py @@ -322,11 +322,14 @@ class _AsyncEventContextImpl(EventContext): self._current_state_ids = yield self._storage.state.get_state_ids_for_group( self.state_group ) - if self._prev_state_id and self._event_state_key is not None: + if self._event_state_key is not None: self._prev_state_ids = dict(self._current_state_ids) key = (self._event_type, self._event_state_key) - self._prev_state_ids[key] = self._prev_state_id + if self._prev_state_id: + self._prev_state_ids[key] = self._prev_state_id + else: + self._prev_state_ids.pop(key, None) else: self._prev_state_ids = self._current_state_ids |