summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--synapse/events/builder.py5
-rw-r--r--tests/handlers/test_federation_event.py17
2 files changed, 19 insertions, 3 deletions
diff --git a/synapse/events/builder.py b/synapse/events/builder.py
index e2ee10dd3d..87a0331868 100644
--- a/synapse/events/builder.py
+++ b/synapse/events/builder.py
@@ -132,6 +132,11 @@ class EventBuilder:
             auth_event_ids = self._event_auth_handler.compute_auth_events(
                 self, state_ids
             )
+            logger.info(
+                "builder.build state_ids=%s auth_event_ids=%s",
+                state_ids,
+                auth_event_ids,
+            )
 
         format_version = self.room_version.event_format
         # The types of auth/prev events changes between event versions.
diff --git a/tests/handlers/test_federation_event.py b/tests/handlers/test_federation_event.py
index eaa0c66553..f5abcb5c0f 100644
--- a/tests/handlers/test_federation_event.py
+++ b/tests/handlers/test_federation_event.py
@@ -1044,7 +1044,10 @@ class FederationEventHandlerTests(unittest.FederatingHomeserverTestCase):
                 prev_event_ids=[event_before.event_id],
                 # allow_no_prev_events=True,
                 # prev_event_ids=[],
-                auth_event_ids=historical_base_auth_event_ids,
+                # auth_event_ids=historical_base_auth_event_ids,
+                #
+                # Because we're creating all of these events without persisting them yet,
+                # we have to explicitly provide some auth_events. For member events, we do it this way.
                 state_event_ids=historical_state_event_ids,
                 depth=inherited_depth,
             )
@@ -1072,11 +1075,13 @@ class FederationEventHandlerTests(unittest.FederatingHomeserverTestCase):
                 prev_event_ids=[maria_membership_event.event_id],
                 # allow_no_prev_events=True,
                 # prev_event_ids=[],
+                # Because we're creating all of these events without persisting them yet,
+                # we have to explicitly provide some auth_events
                 auth_event_ids=[
                     *historical_base_auth_event_ids,
                     as_membership_event.event_id,
                 ],
-                state_event_ids=historical_state_event_ids,
+                # state_event_ids=historical_state_event_ids,
                 depth=inherited_depth,
             )
         )
@@ -1089,6 +1094,8 @@ class FederationEventHandlerTests(unittest.FederatingHomeserverTestCase):
                 type=EventTypes.Message,
                 content={"body": "Historical message", "msgtype": "m.text"},
                 prev_event_ids=[insertion_event.event_id],
+                # Because we're creating all of these events without persisting them yet,
+                # we have to explicitly provide some auth_events
                 auth_event_ids=[
                     *historical_base_auth_event_ids,
                     maria_membership_event.event_id,
@@ -1108,6 +1115,8 @@ class FederationEventHandlerTests(unittest.FederatingHomeserverTestCase):
                     EventContentFields.MSC2716_HISTORICAL: True,
                 },
                 prev_event_ids=[historical_message_event.event_id],
+                # Because we're creating all of these events without persisting them yet,
+                # we have to explicitly provide some auth_events
                 auth_event_ids=[
                     *historical_base_auth_event_ids,
                     as_membership_event.event_id,
@@ -1127,11 +1136,13 @@ class FederationEventHandlerTests(unittest.FederatingHomeserverTestCase):
                     EventContentFields.MSC2716_HISTORICAL: True,
                 },
                 prev_event_ids=[event_before.event_id],
+                # Because we're creating all of these events without persisting them yet,
+                # we have to explicitly provide some auth_events
                 auth_event_ids=[
                     *historical_base_auth_event_ids,
                     as_membership_event.event_id,
                 ],
-                state_event_ids=historical_state_event_ids,
+                # state_event_ids=historical_state_event_ids,
                 depth=inherited_depth,
             )
         )