diff --git a/syncapi/storage/shared/syncserver.go b/syncapi/storage/shared/syncserver.go index b4fa312f0..1b3d6bd8f 100644 --- a/syncapi/storage/shared/syncserver.go +++ b/syncapi/storage/shared/syncserver.go @@ -543,7 +543,13 @@ func (d *Database) GetFilter( func (d *Database) PutFilter( ctx context.Context, localpart string, filter *gomatrixserverlib.Filter, ) (string, error) { - return d.Filter.InsertFilter(ctx, filter, localpart) + var filterID string + var err error + err = d.Writer.Do(nil, nil, func(txn *sql.Tx) error { + filterID, err = d.Filter.InsertFilter(ctx, filter, localpart) + return err + }) + return filterID, err } func (d *Database) IncrementalSync( @@ -607,7 +613,10 @@ func (d *Database) RedactEvent(ctx context.Context, redactedEventID string, reda } newEvent := ev.Headered(redactedBecause.RoomVersion) - return d.OutputEvents.UpdateEventJSON(ctx, &newEvent) + err = d.Writer.Do(nil, nil, func(txn *sql.Tx) error { + return d.OutputEvents.UpdateEventJSON(ctx, &newEvent) + }) + return err } // getResponseWithPDUsForCompleteSync creates a response and adds all PDUs needed