summary refs log tree commit diff
path: root/synapse/state/v2.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-12-18 15:00:34 +0000
committerGitHub <noreply@github.com>2020-12-18 15:00:34 +0000
commit5e7d75daa2d53ea74c75f9a0db52c5590fc22038 (patch)
tree8f2a75480a30fc23283c6c3ebe6d5b4c2426cf67 /synapse/state/v2.py
parentImplement a username picker for synapse (#8942) (diff)
downloadsynapse-5e7d75daa2d53ea74c75f9a0db52c5590fc22038.tar.xz
Fix mainline ordering in state res v2 (#8971)
This had two effects 1) it'd give the wrong answer and b) would iterate
*all* power levels in the auth chain of each event. The latter of which
can be *very* expensive for certain types of IRC bridge rooms that have
large numbers of power level changes.
Diffstat (limited to 'synapse/state/v2.py')
-rw-r--r--synapse/state/v2.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/state/v2.py b/synapse/state/v2.py
index f85124bf81..e585954bd8 100644
--- a/synapse/state/v2.py
+++ b/synapse/state/v2.py
@@ -658,7 +658,7 @@ async def _get_mainline_depth_for_event(
     # We do an iterative search, replacing `event with the power level in its
     # auth events (if any)
     while tmp_event:
-        depth = mainline_map.get(event.event_id)
+        depth = mainline_map.get(tmp_event.event_id)
         if depth is not None:
             return depth