-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix] Channel Members' Roles fetching from ChannelStore instead of UserStore #518
Conversation
This is an overriding PR to your own PR #520 , as this commit is already present in it. I will suggest you to raise only one PR and mention both of your issues in it, indicating that it fixes both if they are dependent on each other because it will create problem while merging the PRs. |
Your assessment is correct; it seems that we are indeed storing all user roles of the channel, so it should be in Let me explain: there is a concept of global scope and room scope in Rocket Chat. The one you are fetching with To implement what you want, the flow will go like this:
All this has to be done just to disable the pin icon. Anyway, if you click on the pin icon, it will display an error message for pinning the message. So, anyway, the API itself won't allow you to pin. But for user experience, if you want to implement this, all of these things have to be taken care of properly before implementing it. You can read the following to understand more about it : https://docs.rocket.chat/use-rocket.chat/workspace-administration/permissions Also have you verified whether roles are not being used anywhere taken from |
Yes, I will raise another PR, drafting #520 now and will delete it after this one has been merged.
Thanks again for your detailed insight into this. I will create another commit fetching the necessary permissions and will do it as you mentioned. Yes all this for pin icon to be not displayed, only for the user experience and the fact that this is also the case for Rocket.Chat |
Hey @sidmohanty11 @abhinavkrin please have a look and suggest any changes if required, as my next PR (#520) also depends on this commit to be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an overriding PR to your own PR #520 , as this commit is already present in it. I will suggest you to raise only one PR and mention both of your issues in it, indicating that it fixes both if they are dependent on each other because it will create problem while merging the PRs.
@thesynthax I think we should follow this, looking at this PR I cannot comprehend what its actually trying to solve. Can you please create one PR with all your changes. Also can you create a discussion thread regarding this in the #embeddedchat channel in RC. I want to understand why this change is required
Hi @sidmohanty11, as mentioned above
I was already planning to do the same. And about the reason for this PR as reviewed by @Spiral-Memory :
and #517 explain the reason for this fix, please check it out. Basically the roles object in userStore was getting overwritten by a function in useFetchChatData.js, which must store the channel members' roles in memberStore and not userStore, as the rolesObj in useFetchChatData.js contains roles for all channel members, not for one single user. userStore should be used for every individual user. |
@thesynthax I'll suggest you to close this PR and complete your original PR and mark it ready for review. In that PR itself, mention both issues. This PR alone doesn't clarify why this fix is required. It can be understood after looking at your PR #520. |
Hey @sidmohanty11 , please merge this PR as Umang has recently created an issue where it will be useful. Let me explain why. When we log in, at that time, the overall role of the person is fetched and saved into userStore. (Workspace level role) However, apart from that, we also have roles specific to channels. Therefore, we fetch channel roles and then save them in the userStore again, which overrides the workspace level roles of the person in the workspace. One solution is to concatenate both roles while saving, as in EC currently we deal with only one channel. However, this solution is also fine and will keep channel-related roles separate from workspace-related roles. Earlier, it wasn't necessary to keep this as separate PR as in his another PR, this commit was already present, but now some issues have been created in which this PR will be useful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thesynthax @Spiral-Memory is this a breaking change? I don't see where we've updated it from userStore, I just see additions made to channelStore
No, this is not a breaking change. Currently, the role saved in 'userRoles' is not used anywhere in the code. However, since this role is more related to the channel than the workspace, he wanted to keep these roles separate as 'memberRoles' (with respect to the channel). He wanted to save workspace-level roles in 'userStore' in his another PR to achieve a better separation between them. This change is not necessary, but it will result in a better separation, that's all. It's just a design choice, nothing much. |
Brief Title
Channel Members' Roles will now fetch from ChannelStore instead of UserStore.
Checkout #517 for the complete details about this fix.
Acceptance Criteria fulfillment
Fixes #517
Video/Screenshots