Create a standard way of updating Compass' preferences on web

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Web
    • 3
    • None
    • Developer Tools

      We have tried to keep updating preferences fully encapsulated inside of Compass. However, recent features and projects from the Atlas side have made it more apparent that we need a standard way of updating Compass' preferences while on the web.

      Currently we only set preferences once, initially, when the CompassWeb component is loaded. See the prop here: 

      Compass: https://github.com/mongodb-js/compass/blob/525e56a8fa8c4aa3b9c07cc527906b9dbf5b59f2/packages/compass-web/src/entrypoint.tsx#L136 

      MMS: https://github.com/10gen/mms/blob/8a7cfce495521be700f59ddf48fecc28b644e02a/client/packages/project/dataExplorerCompassWeb/router.tsx#L137 

      In the recent growth indexes project, we need to pass two booleans which come from mms. We don't want to wait for these preferences to load from the Atlas side and prevent Compass web from rendering, so we want to start them as false and then update them once we load them. See pr https://github.com/mongodb-js/compass/pull/6901 

      Ideally, and keeping in the pattern of how we've been doing things, we would fetch these preferences from Compass itself and then update them from inside Compass. However, then we start to duplicate a lot of the logic in mms' client code base and have to possibly maintain two clientside methods of fetching these preferences.

      The outcome of this ticket is a standard way for updating Compass' preferences from mms, or a standard way of fetching them from Compass so that we don't need to pass them from mms, (and documenting it).

      This includes a bit of investigation as we need to decide which is the best way forward in how we handle things like growth experiment booleans in Compass.

      See https://github.com/mongodb-js/compass/pull/6901  from the tech design  https://docs.google.com/document/d/1wf5x58vRqfTr_5xmhgM1j01VlIkvjnvQRiiyIo57L6Q/edit?tab=t.0#heading=h.my8l8kwcujpo for more context on a place that would use something like this.

            Assignee:
            Unassigned
            Reporter:
            Rhys Howell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: