-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Connectivity, Tech debt
-
None
-
3
-
Iteration Seoul, Iteration Tokyo
-
Not Needed
Currently we only have react error boundaries set up for the various tabs in compass (databases, collections, collection views). We should add error boundaries to the rendering of parts of the connection form as well. It will help gracefully handle errors that occur when the component is rendered. This should ideally should never happen, but in the case that it does happen, a user should be able to see the error that occurred without opening the console, and possibly use other parts of Compass that are unaffected since the error no longer breaks the react window instance (with the connect form this would mean they could choose a non-erroring connection and continue using compass).
React error boundaries:
https://reactjs.org/docs/error-boundaries.html
Here's an example of how we currently handle them in Compass:
https://github.com/mongodb-js/compass/blob/main/packages/compass-collection/src/modules/context.js#L263
This uses the UnsafeComponent component from hadron-react-components: https://github.com/mongodb-js/compass/blob/main/packages/hadron-react-components/src/unsafe-component.jsx
We should update UnsafeComponent to use the current recommended react implementation:
https://reactjs.org/docs/error-boundaries.html
- depends on
-
COMPASS-5229 Create new `connect` package
- Closed
- is related to
-
COMPASS-4462 Connectivity exceptions are not caught in the connection form
- Closed
-
COMPASS-5074 Add error boundary to Compass sidebar
- Closed