aboutsummaryrefslogtreecommitdiff
path: root/roomserver/internal/helpers
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-02-23 15:41:32 +0000
committerGitHub <noreply@github.com>2022-02-23 15:41:32 +0000
commitfea8d152e7d81a9cbd387108d263950d8ec6ddc7 (patch)
treedce949a63a636944d17363ee366880fc184bfd5a /roomserver/internal/helpers
parentb8a97b6ee083d1047d09f99daf2594d0821705ca (diff)
Relax roomserver input transactional isolation (#2224)
* Don't force full transactional isolation on roomserver input * Set succeeded * Tweak `MissingAuthPrevEvents`
Diffstat (limited to 'roomserver/internal/helpers')
-rw-r--r--roomserver/internal/helpers/auth.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/roomserver/internal/helpers/auth.go b/roomserver/internal/helpers/auth.go
index 9af0bf59..0229f822 100644
--- a/roomserver/internal/helpers/auth.go
+++ b/roomserver/internal/helpers/auth.go
@@ -20,22 +20,17 @@ import (
"sort"
"github.com/matrix-org/dendrite/roomserver/state"
+ "github.com/matrix-org/dendrite/roomserver/storage"
"github.com/matrix-org/dendrite/roomserver/types"
"github.com/matrix-org/gomatrixserverlib"
)
-type checkForAuthAndSoftFailStorage interface {
- state.StateResolutionStorage
- StateEntriesForEventIDs(ctx context.Context, eventIDs []string) ([]types.StateEntry, error)
- RoomInfo(ctx context.Context, roomID string) (*types.RoomInfo, error)
-}
-
// CheckForSoftFail returns true if the event should be soft-failed
// and false otherwise. The return error value should be checked before
// the soft-fail bool.
func CheckForSoftFail(
ctx context.Context,
- db checkForAuthAndSoftFailStorage,
+ db storage.Database,
event *gomatrixserverlib.HeaderedEvent,
stateEventIDs []string,
) (bool, error) {
@@ -97,7 +92,7 @@ func CheckForSoftFail(
// Returns the numeric IDs for the auth events.
func CheckAuthEvents(
ctx context.Context,
- db checkForAuthAndSoftFailStorage,
+ db storage.Database,
event *gomatrixserverlib.HeaderedEvent,
authEventIDs []string,
) ([]types.EventNID, error) {