summary refs log tree commit diff
diff options
context:
space:
mode:
authorOlivier Wilkinson (reivilibre) <oliverw@matrix.org>2021-11-04 13:31:01 +0000
committerOlivier Wilkinson (reivilibre) <oliverw@matrix.org>2021-11-04 13:31:01 +0000
commit5352f2109c86116f727634e26598632892683e4a (patch)
tree3494df8d17251ba4f4a06b6df23dfc2c6c9e7664
parentCheck != against StateFilter.none() for clarity (diff)
downloadsynapse-5352f2109c86116f727634e26598632892683e4a.tar.xz
Directly await fetched state for simplicity
-rw-r--r--synapse/storage/databases/state/store.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/synapse/storage/databases/state/store.py b/synapse/storage/databases/state/store.py
index c230822dbb..e4e4fae6b3 100644
--- a/synapse/storage/databases/state/store.py
+++ b/synapse/storage/databases/state/store.py
@@ -365,13 +365,13 @@ class StateGroupDataStore(StateBackgroundUpdateStore, SQLBaseStore):
         fired_off_requests = []
 
         if state_filter_left_over != StateFilter.none():
-            # we need to fire off a request for remaining state
-            # REVIEW log contexts?
-            fired_off_requests.append(
-                make_deferred_yieldable(
-                    self._get_state_for_group_fire_request(group, state_filter)
-                )
+            # Fetch remaining state
+            remaining = await self._get_state_for_group_fire_request(
+                group, state_filter_left_over
             )
+            assembled_state: MutableStateMap[str] = dict(remaining)
+        else:
+            assembled_state = {}
 
         for request in reusable_requests:
             # Observe the requests that we want to re-use
@@ -384,7 +384,6 @@ class StateGroupDataStore(StateBackgroundUpdateStore, SQLBaseStore):
         )
 
         # assemble our result.
-        assembled_state: MutableStateMap[str] = {}
         for result_piece in gathered:
             assembled_state.update(result_piece)