Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 446fae6

Browse files
committed
Add a robustness check for partial-stated outliers
1 parent f499f40 commit 446fae6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

synapse/storage/databases/main/events.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2142,6 +2142,14 @@ def _store_event_state_mappings_txn(
21422142
state_groups = {}
21432143
for event, context in events_and_contexts:
21442144
if event.internal_metadata.is_outlier():
2145+
# double-check that we don't have any events that claim to be outliers
2146+
# *and* have partial state (which is meaningless: we should have no
2147+
# state at all for an outlier)
2148+
if context.partial_state:
2149+
raise ValueError(
2150+
"Outlier event %s claims to have partial state", event.event_id
2151+
)
2152+
21452153
continue
21462154

21472155
# if the event was rejected, just give it the same state as its

0 commit comments

Comments
 (0)