Skip to content

Conversation

@aKn1ghtOut
Copy link
Contributor

@aKn1ghtOut aKn1ghtOut commented Jan 7, 2021

Checklist

  • I have read the Contributing Guide
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Proposed changes

This PR fixes an issue that happens when you try to edit the info of a room, and save changes after changing the value of "Archived". The archive functionality is handled separately from other room settings. The archived key is not used in the saveRoomSettings method but was still being sent over. Hence, the request was being considered invalid. I deleted the "archived" key from the data being sent in the request, making the request valid again.

Issue(s)

Closes #20079

Steps to test or reproduce

  • Edit Info of Room as a user.
  • Change the value of "Archived"
  • Click "Save Changes".
  • "error-invalid-settings" error is shown

Further comments

I considered not editing the data object, itself and instead of editing a copy of the data object, but it is itself being copied inside the function itself and does not affect anything else.
Another option that could be considered instead would be to manually unpack all the different values that can be present as in "client/views/admin/rooms/EditRoom.js", lines 128 to 140, but that might bring along unnecessary complexity.

@aKn1ghtOut aKn1ghtOut changed the title Fix20079 [FIX] Fix error that occurs on changing archive status of room Jan 7, 2021
@aKn1ghtOut
Copy link
Contributor Author

@ggazzo @dougfabris Please have a look

@ggazzo ggazzo merged commit 2ab9294 into RocketChat:develop Jan 19, 2021
@sampaiodiego sampaiodiego mentioned this pull request Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Error message is displayed while archiving a room.

2 participants