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 (#10938)
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 authored and reivilibre committed Sep 30, 2021
1 parent a03ed5e commit c4bf48e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
1 change: 1 addition & 0 deletions changelog.d/10938.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug introduced in Synapse 1.44 which caused the experimental [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) `/batch_send` endpoint to return a 500 error.
13 changes: 4 additions & 9 deletions synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,18 +952,13 @@ async def create_new_client_event(
depth=depth,
)

old_state = None

# 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)
event.internal_metadata.outlier = True
context = EventContext.for_outlier()
else:
context = await self.state.compute_event_context(event)

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

0 comments on commit c4bf48e

Please sign in to comment.