Closed umangutkarsh closed 1 week ago
Hey @umangutkarsh, I am currently working on this issue and I found another bug. that RCInstance.userInfo() does not working properly even if the user is logged in
output:
I have used currentUser from userStore(currentUser)
Hey I found an alternate way
const userRes = await RCInstance.getAuth();
const isAdmin = userRes.currentUser.me.roles.includes('admin');
this works
By this I solved the second point i.e, The read-only is also set for admins which should not be the case.
Now working on remaining 2 points
Hey @umangutkarsh, on changing the room to readonly in Rocket chat, it gives a warning in EC, I think due to that it preventing the dynamic reload
Warning is
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
at ChatBody (http://localhost:6006/src_index_js.iframe.bundle.js:7190:3)
at div
at http://localhost:6006/vendors-node_modules_emotion_react_dist_emotion-react_browser_esm_js.iframe.bundle.js:1847:66
at http://localhost:6006/src_components_Modal_index_js.iframe.bundle.js:158:3
at http://localhost:6006/vendors-node_modules_emotion_react_dist_emotion-react_browser_esm_js.iframe.bundle.js:1847:66
at div
at http://localhost:6006/vendors-node_modules_emotion_react_dist_emotion-react_browser_esm_js.iframe.bundle.js:1847:66
at http://localhost:6006/src_components_Modal_index_js.iframe.bundle.js:158:3
at http://localhost:6006/vendors-node_modules_emotion_react_dist_emotion-react_browser_esm_js.iframe.bundle.js:1847:66
at ChatLayout (http://localhost:6006/src_index_js.iframe.bundle.js:9251:71)
at ToastBarProvider (http://localhost:6006/src_index_js.iframe.bundle.js:4362:3)
at div
at http://localhost:6006/vendors-node_modules_emotion_react_dist_emotion-react_browser_esm_js.iframe.bundle.js:1847:66
at http://localhost:6006/src_components_Modal_index_js.iframe.bundle.js:158:3
at http://localhost:6006/vendors-node_modules_emotion_react_dist_emotion-react_browser_esm_js.iframe.bundle.js:1847:66
at ThemeProvider (http://localhost:6006/vendors-node_modules_emotion_react_dist_emotion-react_browser_esm_js.iframe.bundle.js:1886:64)
at EmbeddedChat (http://localhost:6006/src_index_js.iframe.bundle.js:9868:3)
at unboundStoryFn (http://localhost:6006/sb-preview/runtime.js:41:3330)
at ErrorBoundary (http://localhost:6006/vendors-node_modules_storybook_addon-essentials_dist_actions_preview_mjs-node_modules_storybo-642a8b.iframe.bundle.js:1485:429)
Could you please help me how to tackle this one?
Hey @devanshkansagra
There are many issues with state updates in the application.. it's very difficult to find the exact cause of this issue specifically.
You try to debug it with console logs and figure out what might be causing it.. remove piece of code, understand it and try fixing it.
Also this issue has nothing to do with readonly channels.. in normal channels also, this warning is present
I have fixed the second point, just check it out
Hey @devanshkansagra
There are many issues with state updates in the application.. it's very difficult to find the exact cause of this issue specifically.
You try to debug it with console logs and figure out what might be causing it.. remove piece of code, understand it and try fixing it.
Also this issue has nothing to do with readonly channels.. in normal channels also, this warning is present
Hey @Spiral-Memory, could you please give an idea that how rocket.chat does this(the dynamic load), so that I can get reference and I can debug easily
I'll suggest not doing it dynamically for now, there are many issues that need more attention than this.. however, it can be done, by studying the EmbeddedChat API, you will see a connect function there.. in that function we listen to realtime events.
You can specify the event there, and trigger a callback function to achieve it
Ok so do I push the second point of the issue?
If you want to work on a good issue that I'm trying to fix for months.. let me know.. I'll tell you one
If you want to work on a good issue that I'm trying to fix for months.. let me know.. I'll tell you one
Yeah sure I am very excited and interested
Ok so do I push the second point of the issue?
It is solved so...
Yep, raise your PR, I'll review it once ! Thanks a lot for your contribution 😊
If you want to work on a good issue that I'm trying to fix for months.. let me know.. I'll tell you one
Yeah sure I am very excited and interested
Great, let me raise that issue for you !
Yea ok
I also found one issue, not regarding this but the different one
Sure, do let me know that issue !
Let's connect on open.rocket.chat, create an account there, and let me know your username, I'll DM you.. let's discuss regarding this there !
Yea, sure
If you want to work on a good issue that I'm trying to fix for months.. let me know.. I'll tell you one
Yeah sure I am very excited and interested
Great, let me raise that issue for you !
could you please do so that I can raise the PR
If you want to work on a good issue that I'm trying to fix for months.. let me know.. I'll tell you one
Yeah sure I am very excited and interested
Great, let me raise that issue for you !
could you please do so that I can raise the PR
Don't be in a hurry about raising PRs.. that issue will take you some time to understand. Give it enough time to understand the issue, and see why this problem happens and how to fix it. I'm raising it right now.. please wait a little !
Ok
Raised that issue ! Check it out
Hey here's my username of rocketchat: devansh.kansagra
Description:
Currently the following are the issues of 'read-only' channel.
Steps to reproduce:
Expected behavior:
The above mentioned issues should be resolved.
Actual behavior:
readonly.webm