From 1e9c1008ecc09f6c7c7c5026665afe39efc7890f Mon Sep 17 00:00:00 2001 From: Jack Weir Date: Thu, 11 Sep 2025 16:22:42 -0400 Subject: [PATCH 1/2] COMPASS-9793: fetch connection info after adding non-retryable error listener --- .../src/stores/connections-store-redux.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/compass-connections/src/stores/connections-store-redux.ts b/packages/compass-connections/src/stores/connections-store-redux.ts index 92da56e5653..9fc1428189b 100644 --- a/packages/compass-connections/src/stores/connections-store-redux.ts +++ b/packages/compass-connections/src/stores/connections-store-redux.ts @@ -1703,14 +1703,6 @@ const connectWithOptions = ( return; } - // We're trying to optimise the initial Compass loading times here: to - // make sure that the driver connection pool doesn't immediately get - // overwhelmed with requests, we fetch instance info only once and then - // pass it down to telemetry and instance model. This is a relatively - // expensive dataService operation so we're trying to keep the usage - // very limited - const instanceInfo = await dataService.instance(); - let showedNonRetryableErrorToast = false; // Listen for non-retry-able errors on failed server heartbeats. // These can happen on compass web when: @@ -1738,6 +1730,14 @@ const connectWithOptions = ( void dataService.disconnect(); } ); + + // We're trying to optimise the initial Compass loading times here: to + // make sure that the driver connection pool doesn't immediately get + // overwhelmed with requests, we fetch instance info only once and then + // pass it down to telemetry and instance model. This is a relatively + // expensive dataService operation so we're trying to keep the usage + // very limited + const instanceInfo = await dataService.instance(); dataService.on('oidcAuthFailed', (error) => { openToast('oidc-auth-failed', { From 4a3a5ed8c4a8383d8a85dd7394689c5293e8b2ff Mon Sep 17 00:00:00 2001 From: Jack Weir Date: Thu, 11 Sep 2025 18:28:21 -0400 Subject: [PATCH 2/2] COMPASS-9793: fetch connection info after all listeners --- .../src/stores/connections-store-redux.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/compass-connections/src/stores/connections-store-redux.ts b/packages/compass-connections/src/stores/connections-store-redux.ts index 9fc1428189b..6d6df20817f 100644 --- a/packages/compass-connections/src/stores/connections-store-redux.ts +++ b/packages/compass-connections/src/stores/connections-store-redux.ts @@ -1730,14 +1730,6 @@ const connectWithOptions = ( void dataService.disconnect(); } ); - - // We're trying to optimise the initial Compass loading times here: to - // make sure that the driver connection pool doesn't immediately get - // overwhelmed with requests, we fetch instance info only once and then - // pass it down to telemetry and instance model. This is a relatively - // expensive dataService operation so we're trying to keep the usage - // very limited - const instanceInfo = await dataService.instance(); dataService.on('oidcAuthFailed', (error) => { openToast('oidc-auth-failed', { @@ -1781,6 +1773,14 @@ const connectWithOptions = ( DataServiceForConnection.set(connectionInfo.id, dataService); + // We're trying to optimise the initial Compass loading times here: to + // make sure that the driver connection pool doesn't immediately get + // overwhelmed with requests, we fetch instance info only once and then + // pass it down to telemetry and instance model. This is a relatively + // expensive dataService operation so we're trying to keep the usage + // very limited + const instanceInfo = await dataService.instance(); + try { await dispatch( saveConnectionInfo(