diff --git a/syncapi/storage/shared/syncserver.go b/syncapi/storage/shared/syncserver.go index 47a472bf..255fe6b5 100644 --- a/syncapi/storage/shared/syncserver.go +++ b/syncapi/storage/shared/syncserver.go @@ -525,7 +525,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(