From b0cd706012b4c9b6724b11e16f19c4cb732ab286 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 25 Feb 2022 11:05:20 +0000 Subject: [PATCH] Topologically sort with `SendEventWithState`, so that earlier events should satisfy auth for later ones --- roomserver/api/wrapper.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roomserver/api/wrapper.go b/roomserver/api/wrapper.go index 012094c62..e70316770 100644 --- a/roomserver/api/wrapper.go +++ b/roomserver/api/wrapper.go @@ -56,6 +56,8 @@ func SendEventWithState( return err } + outliers = gomatrixserverlib.ReverseTopologicalOrdering(outliers, gomatrixserverlib.TopologicalOrderByAuthEvents) + var ires []InputRoomEvent for _, outlier := range outliers { if haveEventIDs[outlier.EventID()] {