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

Commit 3ca7fdb

Browse files
committed
Properly separate the not sent_to_us_directly branch
Since the only way this second block is now reachable is if we *didn't* go into the `sent_to_us_directly` branch, we can replace it with a simple `else`.
1 parent 51e2dd8 commit 3ca7fdb

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

synapse/handlers/federation.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ async def on_receive_pdu(
351351
affected=pdu.event_id,
352352
)
353353

354-
if missing_prevs:
354+
else:
355355
# We don't have all of the prev_events for this event.
356356
#
357357
# In this case, we need to fall back to asking another server in the
@@ -360,10 +360,7 @@ async def on_receive_pdu(
360360
# will ensure that you can't just take over a room by sending an event,
361361
# withholding its prev_events, and declaring yourself to be an admin in
362362
# the subsequent state request).
363-
364-
# this should now be unreachable if the event was pushed to us
365-
assert not sent_to_us_directly
366-
363+
#
367364
# Since we're pulling this event as a missing prev_event, then clearly
368365
# this event is not going to become the only forward-extremity and we are
369366
# guaranteed to resolve its state against our existing forward

0 commit comments

Comments
 (0)