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

[MM-55526] Fix slash command failure when issued from Calls thread #65

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

streamer45
Copy link
Contributor

Summary

Some slash commands are not working when issued from the Calls chat thread (in the pop out window). I thought it was a Calls issue but locally it didn't happen so I debugged a bit on Community and the exception is actually coming from this plugin (see screenshot). The returned providerConfiguration can be null which will cause an exception and break the whole chain of slash handlers.

image

Ticket Link

https://mattermost.atlassian.net/browse/MM-55526

@streamer45 streamer45 added the 2: Dev Review Requires review by a core committer label Dec 6, 2023
@streamer45 streamer45 self-assigned this Dec 6, 2023
@mickmister
Copy link
Contributor

I'm thinking the webapp code that runs the hooks (e.g. slashCommandWillBePosted) should be made more resilient, so when errors like this happen, it doesn't bubble up and cause short-circuiting like this. In this case, it's a bit of undefined behavior, because this is a "plugin may want to short-circuit and handle the operation", rather than a pure "fire and forget" hook.

Either way, I'm thinking there should be some error-handling around calling these hooks, as we should assume that an error could happen in any of these plugin hooks.

@streamer45
Copy link
Contributor Author

@mickmister Agreed 💯 Would you mind filing a ticket? I think it could be a very good improvement.

@mickmister
Copy link
Contributor

@streamer45 There are two related tickets I created in the past that cover this. There was some work to introduce error boundaries for the plugin React components (though not merged), and the smaller-scoped work for the function hooks like slashCommandWillBePosted got lost in the seams of things.

mattermost/mattermost-webapp#11467
https://mattermost.atlassian.net/browse/MM-42330 - mentions handling hooks like slashCommandWillBePosted
https://mattermost.atlassian.net/browse/MM-42329

@streamer45
Copy link
Contributor Author

Thanks for the extra context. It looks like the work was ready to be merged, pending QA. Wondering how much effort it would be to rebase it now. It's a pity to see such a good effort go wasted.

Copy link
Member

@cpoile cpoile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree that we should handle this better centrally, but for now we can fix this too.

@mickmister mickmister added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer labels Dec 7, 2023
@mickmister mickmister merged commit e6160d6 into master Dec 7, 2023
4 checks passed
@mickmister mickmister deleted the MM-55526 branch December 7, 2023 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants