Skip to content

Commit 0e57c33

Browse files
authored
Do a clearer join -> join transition for restricted rooms tests. (#208)
This exposes a bug in Synapse where a join -> join transition could cause a bogus "join_authorised_via_users_server" field to be included in the event.
1 parent 97183bf commit 0e57c33

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/restricted_rooms_test.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,21 @@ func checkRestrictedRoom(t *testing.T, alice *client.CSAPI, bob *client.CSAPI, a
8282
bob.JoinRoom(t, room, []string{"hs1"})
8383

8484
// Joining the same room again should work fine (e.g. to change your display name).
85-
bob.JoinRoom(t, room, []string{"hs1"})
85+
bob.SendEventSynced(
86+
t,
87+
room,
88+
b.Event{
89+
Type: "m.room.member",
90+
Sender: bob.UserID,
91+
StateKey: &bob.UserID,
92+
Content: map[string]interface{}{
93+
"membership": "join",
94+
"displayname": "Bobby",
95+
// This should be ignored since this is a join -> join transition.
96+
"join_authorised_via_users_server": "unused",
97+
},
98+
},
99+
)
86100

87101
// Leaving the room works and the user is unable to re-join.
88102
bob.LeaveRoom(t, room)

0 commit comments

Comments
 (0)