Skip to content

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:

  1. tested renaming room within the same group
  2. tested moving the room into different group
  3. tested creating messages from multiple users and then renaming or moving the room
  4. 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)
  5. renamed room and then created a new room with the original name (e.g. creating renaming community/room to community/room2 and then crating new community/room
    • UNEXPECTED BEHAVIOR - I expected creating community/room for the second time will fail or remove its url from renamedLcUris proprty of community/room2. That didn't happen. URL community/room rendered the new room but the community/room2 had community/room still in its renamedLcUris.
    • 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.

Merge request reports