Don't get into situations where we have no forward extremities
MODIFY
roomserver/internal/input/input_latest_events.go
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)
}

Don't get into situations where we have no forward extremities