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

Commit b94ea09

Browse files
committed
Log the differences when the auth events are not the same.
1 parent b5db00f commit b94ea09

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
@@ -1549,6 +1549,29 @@ async def _check_event_auth(
15491549
calculated_auth_event_ids
15501550
)
15511551

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

0 commit comments

Comments
 (0)