Fix logic for dropping old events in fed queue

Fixes infinite loops of

> logger.info("Invalid prev_events for %s", event_id)
dmr/review-hotfixes
Richard van der Hoff 2022-01-23 21:08:52 +00:00
parent 7977b7f6a8
commit 2b9f741f3a
1 changed files with 4 additions and 1 deletions

View File

@ -1432,7 +1432,10 @@ class EventFederationWorkerStore(EventsWorkerStore, SignatureWorkerStore, SQLBas
if room_version.event_format == EventFormatVersions.V1:
for prev_event_tuple in prev_events:
if not isinstance(prev_event_tuple, list) or len(prev_events) != 2:
if (
not isinstance(prev_event_tuple, list)
or len(prev_event_tuple) != 2
):
logger.info("Invalid prev_events for %s", event_id)
break