The source project of this merge request has been removed.
Fix #2089 - `rename-room.js` can move room to a different group
Fix description:
This merge request fixes #2089 (closed) by looking up group from target uri and assigning this group to the room. I'll be referring to community as group because that is its name in the code.
Implementation:
- parsing group uri from argument
- looking up the new group
- validation (group exists, valid room uri)
- assigning groupId to the room (possibly the ID is the same if the group from the argument is the same)
Testing:
There are no automated tests. Description of manual testing follows:
- tested renaming room within the same group
- tested moving the room into different group
- tested creating messages from multiple users and then renaming or moving the room
- tested renaming the room to existing group uri (e.g.
rename-room.js -o community/room -n existingCommunity
(this failed so I implemented guard in the routine) - renamed room and then created a new room with the original name (e.g. creating renaming
community/room
tocommunity/room2
and then crating newcommunity/room
- UNEXPECTED BEHAVIOR - I expected creating
community/room
for the second time will fail or remove its url fromrenamedLcUris
proprty ofcommunity/room2
. That didn't happen. URLcommunity/room
rendered the new room but thecommunity/room2
hadcommunity/room
still in itsrenamedLcUris
. - This merge request didn't introduce this behavior, it's an existing behavior.
- I see that as a large edge case that doesn't need fix in the future.
- UNEXPECTED BEHAVIOR - I expected creating