-
Notifications
You must be signed in to change notification settings - Fork 2.7k
MM-47044 Wrap error boundary around plugin components that are not using Pluggable
component
#11467
Conversation
E2E tests not automatically triggered, because PR has no approval yet. Please ask a developer to review and then try again to attach the QA label. |
@mickmister Could you please resolve the conflicts |
@AshishDhama CI issues fixed 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Heads up that as part of our efforts to move to a monorepo, we're closing out a number of older pull requests like this one to help streamline the effort. If you'd like to preserve these changes -- even if you're not the original author! -- feel free to resubmit the pull request against the monorepo once it's ready. You can subscribe to mattermost-server-issue-22420 for status updates on this effort. |
The PR this is based off of #11149 was closed due to automation when the target branch of that PR was closed, so this is being opened to replace that PR.
Summary
This PR is a continuation of #11148, which adds an error boundary to the Pluggable component. Some plugin components are currently not rendered through the
Pluggable
component. Some components are also stored on a different reducer than the onePluggable
is expecting to find them atstate.plugins.components
.This PR makes it so the following cases have error boundaries added:
state.plugins.components
, but are not using thePluggable
componentEach of these components ideally should use the
Pluggable
component, in order to have a single place to handle plugin-related kill switches etc. At the moment, this PR instead wraps the rendered components with thePluggableErrorBoundary
. One solution to have thePluggable
used by all the components is to have thePluggable
component's props accept an arbitrary list of pluggable components, so it doesn't of requiring the components to be in a specific reducer, and can support custom filtering etc.Another topic - I'm not sure how we can make it so new plugin component types that are introduced use the
Pluggable
component.I'm also wanting to add try/catch blocks around plugin hooks that are function calls unrelated to rendering React components, to further increase the durability against plugin errors.
Ticket Link
https://mattermost.atlassian.net/browse/MM-47044
Related Pull Requests
Screenshots
Screen.Recording.2022-09-17.at.10.28.09.AM.mov
Release Note