From 8035c50c066209108f9ccefebb9e12fdc1df3cab Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 8 Oct 2020 14:46:25 +0100 Subject: [PATCH] Don't get into situations where we have no forward extremities --- roomserver/internal/input/input_latest_events.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roomserver/internal/input/input_latest_events.go b/roomserver/internal/input/input_latest_events.go index b6666cc0..229665a0 100644 --- a/roomserver/internal/input/input_latest_events.go +++ b/roomserver/internal/input/input_latest_events.go @@ -296,7 +296,7 @@ func (u *latestEventsUpdater) calculateLatest( referenced, err := u.updater.IsReferenced(newEvent.EventReference) if err != nil { logrus.WithError(err).Errorf("Failed to retrieve event reference for %q", newEvent.EventReference.EventID) - } else if !referenced { + } else if !referenced || len(newLatest) == 0 { newLatest = append(newLatest, newEvent) }