mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Stop setting the outlier flag for things that aren't (#10614)
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.
This commit is contained in:
parent
642a42edde
commit
272b89d547
1
changelog.d/10614.misc
Normal file
1
changelog.d/10614.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Clean up some of the federation event authentication code for clarity.
|
@ -293,13 +293,7 @@ class FederationHandler(BaseHandler):
|
|||||||
prevs = set(pdu.prev_event_ids())
|
prevs = set(pdu.prev_event_ids())
|
||||||
seen = await self.store.have_events_in_timeline(prevs)
|
seen = await self.store.have_events_in_timeline(prevs)
|
||||||
|
|
||||||
if min_depth is not None and pdu.depth < min_depth:
|
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:
|
|
||||||
missing_prevs = prevs - seen
|
missing_prevs = prevs - seen
|
||||||
if sent_to_us_directly and missing_prevs:
|
if sent_to_us_directly and missing_prevs:
|
||||||
# If we're missing stuff, ensure we only fetch stuff one
|
# If we're missing stuff, ensure we only fetch stuff one
|
||||||
@ -2375,6 +2369,7 @@ class FederationHandler(BaseHandler):
|
|||||||
not event.internal_metadata.is_outlier()
|
not event.internal_metadata.is_outlier()
|
||||||
and not backfilled
|
and not backfilled
|
||||||
and not context.rejected
|
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(
|
await self.action_generator.handle_push_actions_for_event(
|
||||||
event, context
|
event, context
|
||||||
|
Loading…
Reference in New Issue
Block a user