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

Commit 2140243

Browse files
committed
Log the differences when the auth events are not the same.
1 parent 927a718 commit 2140243

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

synapse/handlers/federation_event.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,6 +1552,29 @@ async def _check_event_auth(
15521552
calculated_auth_event_ids
15531553
)
15541554

1555+
# log the differences
1556+
1557+
claimed_auth_event_map = {(e.type, e.state_key): e for e in claimed_auth_events}
1558+
calculated_auth_event_map = {
1559+
(e.type, e.state_key): e for e in calculated_auth_events
1560+
}
1561+
logger.info(
1562+
"event's auth_events are different to our calculated auth_events. "
1563+
"Claimed but not calculated: %s. Calculated but not claimed: %s",
1564+
[
1565+
ev
1566+
for k, ev in claimed_auth_event_map.items()
1567+
if k not in calculated_auth_event_map
1568+
or calculated_auth_event_map[k].event_id != ev.event_id
1569+
],
1570+
[
1571+
ev
1572+
for k, ev in calculated_auth_event_map.items()
1573+
if k not in claimed_auth_event_map
1574+
or claimed_auth_event_map[k].event_id != ev.event_id
1575+
],
1576+
)
1577+
15551578
try:
15561579
check_state_dependent_auth_rules(event, calculated_auth_events)
15571580
except AuthError as e:

0 commit comments

Comments
 (0)