From 9c5f38f9e589b4c308edf309284cd5a80a4bb186 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 11 Feb 2022 13:37:04 +0000 Subject: [PATCH] Fix tests hopefully --- roomserver/internal/input/input_events.go | 2 +- roomserver/storage/shared/room_updater.go | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/roomserver/internal/input/input_events.go b/roomserver/internal/input/input_events.go index e3144d8e9..fcb0c669c 100644 --- a/roomserver/internal/input/input_events.go +++ b/roomserver/internal/input/input_events.go @@ -133,7 +133,7 @@ func (r *Inputer) processRoomEvent( if event.Type() != gomatrixserverlib.MRoomCreate || !event.StateKeyEquals("") { missingAuthIDs, missingPrevIDs, err := updater.MissingAuthPrevEvents(ctx, event) if err != nil { - return rollbackTransaction, fmt.Errorf("r.DB.MissingAuthPrevEvents: %w", err) + return rollbackTransaction, fmt.Errorf("updater.MissingAuthPrevEvents: %w", err) } missingAuth = len(missingAuthIDs) > 0 missingPrev = !input.HasState && len(missingPrevIDs) > 0 diff --git a/roomserver/storage/shared/room_updater.go b/roomserver/storage/shared/room_updater.go index ed7f35e3f..6655d3985 100644 --- a/roomserver/storage/shared/room_updater.go +++ b/roomserver/storage/shared/room_updater.go @@ -100,15 +100,6 @@ func (u *RoomUpdater) CurrentStateSnapshotNID() types.StateSnapshotNID { func (u *RoomUpdater) MissingAuthPrevEvents( ctx context.Context, e *gomatrixserverlib.Event, ) (missingAuth, missingPrev []string, err error) { - var info *types.RoomInfo - info, err = u.RoomInfo(ctx, e.RoomID()) - if err != nil { - return - } - if info == nil || !info.IsStub { - return - } - for _, authEventID := range e.AuthEventIDs() { if nids, err := u.EventNIDs(ctx, []string{authEventID}); err != nil || len(nids) == 0 { missingAuth = append(missingAuth, authEventID)