mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 12:52:24 +03:00
Cleanup remaining statekey usage for senderIDs (#3106)
This commit is contained in:
parent
832ccc32f6
commit
77d9e4e93d
62 changed files with 760 additions and 455 deletions
|
@ -722,7 +722,7 @@ func TestQueryRestrictedJoinAllowed(t *testing.T) {
|
|||
|
||||
roomID, _ := spec.NewRoomID(testRoom.ID)
|
||||
userID, _ := spec.NewUserID(bob.ID, true)
|
||||
got, err := rsAPI.QueryRestrictedJoinAllowed(processCtx.Context(), *roomID, *userID)
|
||||
got, err := rsAPI.QueryRestrictedJoinAllowed(processCtx.Context(), *roomID, spec.SenderID(userID.String()))
|
||||
if tc.wantError && err == nil {
|
||||
t.Fatal("expected error, got none")
|
||||
}
|
||||
|
@ -821,17 +821,6 @@ func TestUpgrade(t *testing.T) {
|
|||
validateFunc func(t *testing.T, oldRoomID, newRoomID string, rsAPI api.RoomserverInternalAPI)
|
||||
wantNewRoom bool
|
||||
}{
|
||||
{
|
||||
name: "invalid userID",
|
||||
upgradeUser: "!notvalid:test",
|
||||
roomFunc: func(rsAPI api.RoomserverInternalAPI) string {
|
||||
room := test.NewRoom(t, alice)
|
||||
if err := api.SendEvents(ctx, rsAPI, api.KindNew, room.Events(), "test", "test", "test", nil, false); err != nil {
|
||||
t.Errorf("failed to send events: %v", err)
|
||||
}
|
||||
return room.ID
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "invalid roomID",
|
||||
upgradeUser: alice.ID,
|
||||
|
@ -1049,7 +1038,11 @@ func TestUpgrade(t *testing.T) {
|
|||
}
|
||||
roomID := tc.roomFunc(rsAPI)
|
||||
|
||||
newRoomID, err := rsAPI.PerformRoomUpgrade(processCtx.Context(), roomID, tc.upgradeUser, version.DefaultRoomVersion())
|
||||
userID, err := spec.NewUserID(tc.upgradeUser, true)
|
||||
if err != nil {
|
||||
t.Fatalf("upgrade userID is invalid")
|
||||
}
|
||||
newRoomID, err := rsAPI.PerformRoomUpgrade(processCtx.Context(), roomID, *userID, version.DefaultRoomVersion())
|
||||
if err != nil && tc.wantNewRoom {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue