Previously we were sending the data service with the data-service-initialized event. This event would pass a connection which is not guaranteed to successfully connect, and keeping it around in other plugins will cause unexpected errors. We are removing data-service-initialized event to avoid using an unreliable connection. When removing it we still need to listen to the server topology description changed event which occurs before connecting.
This PR updates the data service to store the most recent server TopologyDescription so that we no longer need to listen to a non-connected connection inside of Compass plugins which assume connectivity. (and we can remove the data-service-initialized event).
COMPASS-4568
Previously we were sending the data service with the
data-service-initialized
event. This event would pass a connection which is not guaranteed to successfully connect, and keeping it around in other plugins will cause unexpected errors. We are removing data-service-initialized event to avoid using an unreliable connection. When removing it we still need to listen to the server topology description changed event which occurs before connecting. This PR updates the data service to store the most recent server TopologyDescription so that we no longer need to listen to a non-connected connection inside of Compass plugins which assume connectivity. (and we can remove thedata-service-initialized
event).Related:
compass-connect
PR: https://github.com/mongodb-js/compass-connect/pull/252compass-deployment-awareness
PR: https://github.com/mongodb-js/compass-deployment-awareness/pull/183 (will be updated with this new data-service functionality after this is merged.)