From 6411457f8b90e70dc473af6004620cd9defd935c Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 18 Aug 2022 09:43:00 +0100 Subject: [PATCH] Only apply rejection check to outliers --- roomserver/internal/input/input_events.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/roomserver/internal/input/input_events.go b/roomserver/internal/input/input_events.go index 6d4bd548e..53ccd5973 100644 --- a/roomserver/internal/input/input_events.go +++ b/roomserver/internal/input/input_events.go @@ -119,11 +119,12 @@ func (r *Inputer) processRoomEvent( return fmt.Errorf("room %s does not exist for event %s", event.RoomID(), event.EventID()) } - // If we already know about this event and it hasn't been rejected - // then we won't attempt to reprocess it. If it was rejected then we - // can attempt to reprocess, in case we have learned something new - // that will allow us to accept the event this time. - if roomInfo != nil { + // If we already know about this outlier and it hasn't been rejected + // then we won't attempt to reprocess it. If it was rejected or has now + // arrived as a different kind of event, then we can attempt to reprocess, + // in case we have learned something new or need to weave the event into + // the DAG now. + if input.Kind == api.KindOutlier && roomInfo != nil { wasRejected, werr := r.DB.IsEventRejected(ctx, roomInfo.RoomNID, event.EventID()) switch { case werr == sql.ErrNoRows: