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

Commit

Permalink
Fix event context for outliers in important MSC2716 spot
Browse files Browse the repository at this point in the history
Fix event context for outlier causing failures in all of the MSC2716
Complement tests.

The `EventContext.for_outlier` refactor happened in #10883
and this spot was left out.
  • Loading branch information
MadLittleMods committed Sep 29, 2021
1 parent 9fd057b commit 64448b3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -953,18 +953,13 @@ async def create_new_client_event(
depth=depth,
)

old_state = None
context = await self.state.compute_event_context(event)

# Pass on the outlier property from the builder to the event
# after it is created
if builder.internal_metadata.outlier:
event.internal_metadata.outlier = builder.internal_metadata.outlier

# Calculate the state for outliers that pass in their own `auth_event_ids`
if auth_event_ids:
old_state = await self.store.get_events_as_list(auth_event_ids)

context = await self.state.compute_event_context(event, old_state=old_state)
context = EventContext.for_outlier()

if requester:
context.app_service = requester.app_service
Expand Down

0 comments on commit 64448b3

Please sign in to comment.