RocketChat / EmbeddedChat

An easy to use full-stack component (ReactJS) embedding Rocket.Chat into your webapp
https://rocketchat.github.io/EmbeddedChat/docs
126 stars 252 forks source link

[BUG] Embedded chat malfunctions with differing channel permissions (e.g., read-only, private) and non-existent channels. #417

Closed Spiral-Memory closed 10 months ago

Spiral-Memory commented 10 months ago

Description:

In this issue, I would like to discuss some bugs and the related features that are required for the Embedded chat app. This application does not work properly when the channel permissions are different (read-only or private) or when the channel does not exist on the server.

Steps to reproduce:

  1. Setup the Rocket.Chat Server.
  2. Adjust the channel permissions to either read-only or private.
  3. Access the embedded chat, log in, and compare the observed behavior with the expected.
  4. Optionally, test the behavior by attempting to use a non-existent roomName.

Expected behavior:

  1. In the case of a read-only channel, we should allow users to log in and read messages. The message box should be disabled for them. However, if the user has permission to read messages in a read-only channel, they should be allowed to do so.

  2. When the channel is private, only permit users who have joined or have permission to log in and communicate. Logout any user attempting to log in with information that suggests the channel doesn't exist or they are not allowed to join.

  3. If the channel doesn't exist on the network, notify the user that the channel doesn't exist on the server, and then proceed to log them out.

Actual behavior:

Note: In the video, zishan.barun@gmail.com is the authorized user and ahmadzishan7277@gmail.com is the unauthorized user. This is to demonstrate the functionality of the app.

  1. In read-only channels, the message box is not disabled for users without permission to write messages. If they attempt to write, they get logged out, which is unexpected since they should at least be allowed to read messages.

https://github.com/RocketChat/EmbeddedChat/assets/78961432/116036ca-46ee-4ff6-ac20-085cc227a426

  1. For private channels, users with permission can't see older messages, although they can send messages. Users not members of the private channel can still log in, but they get logged out when trying to send a message without receiving any information on why they were logged out resulting in an unpleasant experience.

https://github.com/RocketChat/EmbeddedChat/assets/78961432/e0055a83-8598-4592-a791-0bfef3ba12c5

  1. When channel doesn't exist on the server, users can still log in and stay until they send a message. However, they are then logged out without receiving any reason, resulting in an unpleasant experience for users.

https://github.com/RocketChat/EmbeddedChat/assets/78961432/f0403b4a-09d9-49b9-83f4-2f03ab9c9c5b

Spiral-Memory commented 10 months ago

@abhinavkrin , I believe addressing these issues is crucial for both administrators setting up embedded chat on their pages and users accessing it. Resolving these problems will not only enhance functionality but also improve error resolution by providing clear messages. Also, it will help to maintain consistency with how Rocket Chat operates with permissioned channels especially the issue 1 and 3. If you agree that these issues are significant and should be resolved, please let me know. I would like to work on addressing these issues.

abhinavkrin commented 10 months ago

Hey @Spiral-Memory I appreciate the descriptive explanation of the issues you have put. I do feel these need to be fixed. Since you have mentioned multiple issues, we should create a separate issue for each topic and then discuss/work on the potential solutions.

Spiral-Memory commented 10 months ago

Thanks for the appreciation. Sure, I will create a separate issue for each and will discuss potential solutions in those. I would be happy to work on these issues. I am closing this issue, and I will create separate ones. Thanks.