1
0

Explain why auth/state necessary here

This commit is contained in:
Eric Eastwood
2022-09-30 00:47:13 -05:00
parent 8f8c1a08d8
commit 3f8fef2beb
2 changed files with 19 additions and 3 deletions

View File

@@ -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.

View File

@@ -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,
)
)