Fix tests hopefully

This commit is contained in:
Neil Alexander 2022-02-11 13:37:04 +00:00
parent cda580bdbe
commit 9c5f38f9e5
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 1 additions and 10 deletions

View file

@ -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

View file

@ -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)