Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-5075

Add react error boundaries to `connect`

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.31.0
    • Affects Version/s: None
    • Component/s: Connectivity, Tech debt
    • Labels:
      None
    • 3
    • Not Needed
    • Iteration Seoul, Iteration Tokyo

      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

            Assignee:
            rhys.howell@mongodb.com Rhys Howell
            Reporter:
            rhys.howell@mongodb.com Rhys Howell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: