mattermost-plugin-zoom
mattermost-plugin-zoom copied to clipboard
Webapp crashes when a new user select an option from the PMI setting option for the first time
Summary
Note: This behavior is only observed on the newer version of MM (Tested on v9.0.0) and it is working fine on the older version (Tested on v5.37.0). This makes us think that this might be some issue in the mattermost webapp code.
- Webapp crashes when a new user selects an option from the PMI setting option for the first time.
- Everything works fine if we reload the page after the webapp has crashed.
- After refreshing the page if we ran the settings command again, we saw that the setting was updated.
- Click on the option second time does not crash the webapp.
- No API call is failing in the network tab.
- The term
team_id
is not being used in the plugin code anywhere. - There was an API to fetch the channel details. The response of that API contains an empty
team_id
, maybe that is causing some issues. That value is empty on older versions of MM as well but it is working fine there. Maybe that was not being used in the webapp on older versions.
Error message in console:
[Util] handleError:: Uncaught TypeError: Cannot read properties of undefined (reading 'team_id')
Screenshots
We selected the "No" option in the response below.
Webapp crashed
After refreshing (The setting was updated)
API call to fetch channel details
Steps to reproduce:
- Create a new user on MM latest version.
- Connect your Zoom account.
- Run the
/zoom settings
command. - Click on one of the options from the response.
[Util] handleError:: Uncaught TypeError: Cannot read properties of undefined (reading 'team_id')
This error essentially says "I tried to read from an undefined object, and team_id
happened to be the property I tried to access from this undefined object". So it's not that team_id
is blank, it's that the channel object we're querying is undefined. The team_id
being blank is normal for DMs and GMs.
The issue makes me think there's something different about the redux store or about one of the plugin registry functions. Are you able to trace the code in the zoom plugin to see where the error is occurring? It's going to be a function in mattermost-redux likely, but we need to know the call stack from the plugin source code to that level. I see it's also happening with the gitlab plugin as well, so this indeed points to an issue in the webapp code. One thing we'll want to figure out is the version of Mattermost that introduced the issue, so we can then tell the webapp team what needs to be investigated.
The issue makes me think there's something different about the redux store or about one of the plugin registry functions. Are you able to trace the code in the zoom plugin to see where the error is occurring?
@mickmister I tried adding the print statements in the code of the API called after clicking on the button but everything seemed to be working fine. Also, this is a mattermost interactive message so the plugin's webapp is not included in that
Can you make sure you run make deploy
with the following env vars? I think this may make the console stack traces more useful
MM_SERVICESETTINGS_ENABLEDEVELOPER=true
MM_DEBUG=1
Can you make sure you run
make deploy
with the following env vars? I think this may make the console stack traces more usefulMM_SERVICESETTINGS_ENABLEDEVELOPER=true MM_DEBUG=1
@mickmister Tried this, still getting the same errors in the console.
@mickmister I tried reproducing the above issue on various cloud servers. I was able to run the command /zoom settings
on v6.3.0
, v7.8.10
and the webapp crash occurred on servers like v8.0.0
, v8.1.11
, v9.4.0
.
@raghavaggarwal2308 Okay maybe we can hop on a call to debug this. We can meet before our team meeting tomorrow if that works
@mickmister Sure, sent you an invite. Let me know if it is fine with you.
I did a bit of investigating into this which I posted about here: https://community.mattermost.com/core/pl/zw4zxkubhffsjrtt8n6gmf33by
It seems like an error occurs the first time a user clicks that button, and the Zoom bot DMs you that error. The message it sends is in a newly created DM chanel which isn't loaded by the web app at that point, but that wouldn't normally matter unless the post is rendered. The crash comes from the web app trying to render the error message post despite it being in a different, unloaded channel which is incredibly bizarre
More details can be found here: https://hub.mattermost.com/partners/pl/hax98r87kjda3q8q5tfcrsptto