mattermost / mattermost-plugin-zoom

Zoom plugin for Mattermost :electric_plug:
Apache License 2.0
107 stars 68 forks source link

Zoom plugin while viewing a thread in the Threads view causes a JS error #300

Closed devinbinnie closed 10 months ago

devinbinnie commented 1 year ago

Steps to reproduce:

  1. Have CRT enabled, and open the Threads view
  2. Open a thread that pops into the RHS
  3. Click the Zoom button on the right

Expected: Zoom meeting should post into the thread Observed: Zoom meeting isn’t posted and a JS error occurs

Uncaught TypeError: Cannot read properties of undefined (reading 'id')
    at Object.action (zoom_249d6071dc514b5a_bundle.js:2:360339)
    at onClick (app_bar_plugin_component.tsx:113:21)
    at Object.Be (react-dom.production.min.js:52:317)
    at Ke (react-dom.production.min.js:52:471)
    at react-dom.production.min.js:53:35
    at Pr (react-dom.production.min.js:100:68)
    at Nr (react-dom.production.min.js:101:380)
    at react-dom.production.min.js:113:65
    at De (react-dom.production.min.js:292:189)
    at react-dom.production.min.js:50:57
Kshitij-Katiyar commented 1 year ago

@devinbinnie I tested this bug on mattermost version 8.0.1 and was unable to reproduce it. Please share your mattermost server version.

Kshitij-Katiyar commented 1 year ago

@devinbinnie Currently the meeting link is posted directly to the channel even if a thread is open. Would you like the meeting link to be posted in the thread? @mickmister Can you share your views on this?

devinbinnie commented 1 year ago

@Kshitij-Katiyar I noticed this cropping up on the community server, so the server version will be the latest master. Not sure which version of the Zoom plugin it's on, but I'm assuming it's also the latest.

I would expect the meeting like to be posted to the thread if possible, especially if we're in Threads view and there is not technically an active channel.

mickmister commented 1 year ago

@Kshitij-Katiyar Note that the "Threads" view is different from opening a thread in the RHS in the regular chat view. You need to click "Threads" button in the top left corner of the UI, and then click the Zoom icon.

Kshitij-Katiyar commented 11 months ago

@mickmister While debugging the error above, I looked into the Mattermost Redux state. I found that the currentChannelId is null in the threads view, which is causing the error. Additionally, there is no currentThreadId object in Redux and no other way to get the currentThreadId or currentChannelId of the currently open thread.

One possible solution is to extract the currentThreadId from the URL. I am currently working on this approach, but please let me know if you have any other suggestions.