Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions tests/v12_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,26 @@ func TestMSC4289PrivilegedRoomCreators(t *testing.T) {
)
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably v12 is special because historically Synapse would use the domain in the room ID as a last-ditch server to join via?

-- @kegsay, #843 (comment)

I wouldn't expect this to work in other room versions (unless you backdate events to rollback state).

But for v12, the room creator has ultimate power to do whatever and so should be able to send a m.room.mebership to join again.

t.Run("Room creator can re-join room after everyone left", func(t *testing.T) {
roomID := alice.MustCreateRoom(t, map[string]interface{}{
"room_version": roomVersion12,
})
alice.MustLeaveRoom(t, roomID)
alice.MustJoinRoom(t, roomID, nil)
})

t.Run("Additional room creator can re-join room after everyone left", func(t *testing.T) {
roomID := alice.MustCreateRoom(t, map[string]interface{}{
"room_version": roomVersion12,
"creation_content": map[string]any{
"additional_creators": []string{bob.UserID},
},
})
alice.MustLeaveRoom(t, roomID)
bob.MustLeaveRoom(t, roomID)
bob.MustJoinRoom(t, roomID, nil)
})

t.Run("PL event is missing creator in users map", func(t *testing.T) {
roomID := alice.MustCreateRoom(t, map[string]interface{}{
"room_version": roomVersion12,
Expand Down
Loading