Cleanup, fix test

This commit is contained in:
Till Faelligen 2023-06-15 14:05:26 +02:00
parent 7f41a6a3f0
commit 07960a5efc
No known key found for this signature in database
GPG key ID: ACCDC9606D472758
2 changed files with 7 additions and 3 deletions

View file

@ -54,7 +54,13 @@ func TestCurrentRoomStateTable(t *testing.T) {
events := room.CurrentState()
err := sqlutil.WithTransaction(db, func(txn *sql.Tx) error {
for i, ev := range events {
err := tab.UpsertRoomState(ctx, txn, ev, nil, types.StreamPosition(i))
ev.StateKeyResolved = ev.StateKey()
userID, err := spec.NewUserID(string(ev.SenderID()), true)
if err != nil {
return err
}
ev.UserID = *userID
err = tab.UpsertRoomState(ctx, txn, ev, nil, types.StreamPosition(i))
if err != nil {
return fmt.Errorf("failed to UpsertRoomState: %w", err)
}

View file

@ -503,8 +503,6 @@ func (rp *RequestPool) OnIncomingSyncRequest(req *http.Request, device *userapi.
}
}
logrus.Infof("%#v", syncReq.Response.Rooms.Join)
return util.JSONResponse{
Code: http.StatusOK,
JSON: syncReq.Response,