This commit is contained in:
Kegan Dougal 2020-07-07 12:09:13 +01:00
parent 7f78bdd2ac
commit 007afcae60
2 changed files with 6 additions and 5 deletions

View file

@ -32,6 +32,8 @@ import (
// TODO(#375): This should be rewritten to allow concurrent calls. The // TODO(#375): This should be rewritten to allow concurrent calls. The
// difficulty is in ensuring that we correctly annotate events with the correct // difficulty is in ensuring that we correctly annotate events with the correct
// state deltas when sending to kafka streams // state deltas when sending to kafka streams
// TODO: Break up function - we should probably do transaction ID checks before calling this.
// nolint:gocyclo
func (r *RoomserverInternalAPI) processRoomEvent( func (r *RoomserverInternalAPI) processRoomEvent(
ctx context.Context, ctx context.Context,
input api.InputRoomEvent, input api.InputRoomEvent,
@ -67,9 +69,9 @@ func (r *RoomserverInternalAPI) processRoomEvent(
} }
// if storing this event results in it being redacted then do so. // if storing this event results in it being redacted then do so.
if redactedEventID == event.EventID() { if redactedEventID == event.EventID() {
r, err := eventutil.RedactEvent(redactionEvent, &event) r, rerr := eventutil.RedactEvent(redactionEvent, &event)
if err != nil { if rerr != nil {
return "", err return "", rerr
} }
event = *r event = *r
} }

View file

@ -18,8 +18,7 @@ import (
) )
const ( const (
testOrigin = gomatrixserverlib.ServerName("kaer.morhen") testOrigin = gomatrixserverlib.ServerName("kaer.morhen")
testDestination = gomatrixserverlib.ServerName("white.orchard")
// we have to use an on-disk DB because we open multiple connections due to the *Updater structs. // we have to use an on-disk DB because we open multiple connections due to the *Updater structs.
// Using :memory: results in a brand new DB for each open connection, and sharing memory via // Using :memory: results in a brand new DB for each open connection, and sharing memory via
// ?cache=shared just allows read-only sharing, so writes to the database on other connections are lost. // ?cache=shared just allows read-only sharing, so writes to the database on other connections are lost.