From 078345a29debf62321f0a72782a6b72e96011775 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 21 Jan 2022 09:55:13 +0000 Subject: [PATCH] Tweak logic around checking missing state --- roomserver/internal/input/input_events.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roomserver/internal/input/input_events.go b/roomserver/internal/input/input_events.go index cdf968cb8..521ba6d18 100644 --- a/roomserver/internal/input/input_events.go +++ b/roomserver/internal/input/input_events.go @@ -166,8 +166,8 @@ func (r *Inputer) processRoomEvent( } } - missingPrev := false - if input.Kind != api.KindOutlier && len(missingRes.MissingPrevEventIDs) > 0 { + missingPrev := len(missingRes.MissingPrevEventIDs) > 0 + if missingPrev && input.Kind != api.KindOutlier { if len(serverRes.ServerNames) > 0 { missingState := missingStateReq{ origin: input.Origin, @@ -183,12 +183,12 @@ func (r *Inputer) processRoomEvent( } if err = missingState.processEventWithMissingState(ctx, input.Event.Unwrap(), input.Event.RoomVersion); err != nil { isRejected = true - missingPrev = true rejectionErr = fmt.Errorf("missingState.processEventWithMissingState: %w", err) + } else { + missingPrev = false } } else { isRejected = true - missingPrev = true rejectionErr = fmt.Errorf("missing prev events and no other servers to ask") } }