From 1f15cfc6a3ded8c1776ad2a7ae345f199b20e1e0 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 16 Aug 2022 16:31:46 +0100 Subject: [PATCH] Might as well do all events this way --- roomserver/internal/input/input_events.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/roomserver/internal/input/input_events.go b/roomserver/internal/input/input_events.go index 018d5ec9f..c27a3152f 100644 --- a/roomserver/internal/input/input_events.go +++ b/roomserver/internal/input/input_events.go @@ -107,19 +107,17 @@ func (r *Inputer) processRoomEvent( }) } - // If we already know about this outlier and it hasn't been rejected + // 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 input.Kind == api.KindOutlier { - rejected, err := r.DB.IsEventRejected(ctx, event.EventID()) - if err != nil && err != sql.ErrNoRows { - return err - } - if !rejected { - logger.Debugf("Already processed event %q, ignoring", event.EventID()) - return nil - } + wasRejected, werr := r.DB.IsEventRejected(ctx, event.EventID()) + if werr != nil && werr != sql.ErrNoRows { + return werr + } + if !wasRejected { + logger.Debugf("Already processed event %q, ignoring", event.EventID()) + return nil } // Don't waste time processing the event if the room doesn't exist.