Closed Spiral-Memory closed 9 months ago
Hey @abhinavkrin , I would like to work on this issue as discussed, I feel that the problem arises because the API used to fetch channel information is /api/v1/channels.info,
which can't retrieve the information of private channels. To fetch information of private channels, the API /api/v1/rooms.get
or /api/v1/groups.info
has to be used. Also, we can use the /api/v1/groups.${query}
endpoint to fetch messages and get roles for private channels(groups).The suggested approach is to use both APIs in combination to handle both kinds of channels. Let me know about the approach that you think could be taken to fix this.
I have submitted the PR following the approach I proposed. Please let me know if any changes are necessary.
Note: This PR may lead to merge conflicts with #419 and #421 due to alterations in similar locations. Additionally, PR #427 is essential to maintain synchronization on refresh. These four PRs are closely connected and collectively address the comprehensive issue #417 you advised me to break down into separate tasks. As you begin the review, I will resolve any merge conflicts with each merge. Thank you!
Description:
The application currently cannot fetch the information of a private channel properly. The older messages are not displayed in the private channel, even for authorized users, although they can send messages. Users who are 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.
Steps to reproduce:
Expected behavior:
When the channel is private, only permit users who have joined or have permission to log in and communicate. Also, they must be able to access the channel information and view older messages in the chat. Additionally, log out any unauthorised user attempting to log in with information that suggests the channel doesn't exist or they are not allowed to join.
Actual behavior:
For private channels, users with permission also can't see older messages, although they can send messages. Users who are 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/27441077-aea0-4070-ba80-28167e6f1ec5