Skip to content

Commit

Permalink
Do a clearer join -> join transition for restricted rooms tests. (#208)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
clokep authored Sep 30, 2021
1 parent 97183bf commit 0e57c33
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/restricted_rooms_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,21 @@ func checkRestrictedRoom(t *testing.T, alice *client.CSAPI, bob *client.CSAPI, a
bob.JoinRoom(t, room, []string{"hs1"})

// Joining the same room again should work fine (e.g. to change your display name).
bob.JoinRoom(t, room, []string{"hs1"})
bob.SendEventSynced(
t,
room,
b.Event{
Type: "m.room.member",
Sender: bob.UserID,
StateKey: &bob.UserID,
Content: map[string]interface{}{
"membership": "join",
"displayname": "Bobby",
// This should be ignored since this is a join -> join transition.
"join_authorised_via_users_server": "unused",
},
},
)

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

0 comments on commit 0e57c33

Please sign in to comment.