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

Commit

Permalink
Stop setting the outlier flag for things that aren't (#10614)
Browse files Browse the repository at this point in the history
Marking things as outliers to inhibit pushes is a sledgehammer to crack a
nut. Move the test further down the stack so that we just inhibit the thing we
want.
  • Loading branch information
richvdh authored Aug 17, 2021
1 parent 642a42e commit 272b89d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions changelog.d/10614.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clean up some of the federation event authentication code for clarity.
9 changes: 2 additions & 7 deletions synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,7 @@ async def on_receive_pdu(
prevs = set(pdu.prev_event_ids())
seen = await self.store.have_events_in_timeline(prevs)

if min_depth is not None and pdu.depth < min_depth:
# This is so that we don't notify the user about this
# message, to work around the fact that some events will
# reference really really old events we really don't want to
# send to the clients.
pdu.internal_metadata.outlier = True
elif min_depth is not None and pdu.depth > min_depth:
if min_depth is not None and pdu.depth > min_depth:
missing_prevs = prevs - seen
if sent_to_us_directly and missing_prevs:
# If we're missing stuff, ensure we only fetch stuff one
Expand Down Expand Up @@ -2375,6 +2369,7 @@ async def _run_push_actions_and_persist_event(
not event.internal_metadata.is_outlier()
and not backfilled
and not context.rejected
and (await self.store.get_min_depth(event.room_id)) <= event.depth
):
await self.action_generator.handle_push_actions_for_event(
event, context
Expand Down

0 comments on commit 272b89d

Please sign in to comment.