Skip to content
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

Channel Members' Roles getting fetched using useUserStore #517

Closed
thesynthax opened this issue Mar 13, 2024 · 0 comments · Fixed by #518
Closed

Channel Members' Roles getting fetched using useUserStore #517

thesynthax opened this issue Mar 13, 2024 · 0 comments · Fixed by #518
Labels
bug Something isn't working

Comments

@thesynthax
Copy link
Contributor

Description:

While working on a feature requiring fetching the current user's roles in MessageToolbox.js (image 2, 4), I encountered a bug while console logging (image 1) the roles object that it was getting overwritten by some other function. After finding out which function was responsible, I saw that useFetchChatData.js was fetching channel members' roles and storing it in UserStore, which is specific to each user. useFetchChatData should instead use ChannelStore to store channel members' roles as the rolesObj contains roles information for all multiple users (image 3).

Expected behavior:

While console logging, the roles object should not be empty unlike in image 1.

Actual behavior:

ss_139
ss_140
ss_141
ss_142

Solution:

ChannelStore must contain a variable for storing members' roles and UserStore should not be used for this purpose.

I will be raising a PR fixing this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant