Skip to content

Commit 26cab4f

Browse files
committed
fix terminated cluster states
1 parent 40f3b05 commit 26cab4f

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

packages/compass-web/src/connection-storage.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,7 @@ export function buildConnectionInfoFromClusterDescription(
207207
const instanceSize = getInstanceSize(description);
208208

209209
return {
210-
// Cluster name is unique inside the project (hence using it in the backend
211-
// urls as identifier) and using it as an id makes our job of mapping routes
212-
// to compass state easier
213-
id: description.name,
210+
id: description.uniqueId,
214211
connectionOptions: {
215212
connectionString: connectionString.toString(),
216213
lookup: () => {
@@ -265,7 +262,7 @@ export class AtlasCloudConnectionStorage
265262
implements ConnectionStorage
266263
{
267264
private loadAllPromise: Promise<ConnectionInfo[]> | undefined;
268-
private canUseNewConnectionInfoEndpoint = true;
265+
private useNewConnectionInfoEndpoint = true;
269266
constructor(
270267
private atlasService: AtlasService,
271268
private orgId: string,
@@ -420,15 +417,10 @@ export class AtlasCloudConnectionStorage
420417

421418
loadAll(): Promise<ConnectionInfo[]> {
422419
this.loadAllPromise ??= (async () => {
423-
if (this.canUseNewConnectionInfoEndpoint === false) {
424-
return this._loadAndNormalizeClusterDescriptionInfoV1();
425-
}
426-
try {
427-
return await this._loadAndNormalizeClusterDescriptionInfoV2();
428-
} catch (err) {
429-
this.canUseNewConnectionInfoEndpoint = false;
420+
if (this.useNewConnectionInfoEndpoint === false) {
430421
return this._loadAndNormalizeClusterDescriptionInfoV1();
431422
}
423+
return await this._loadAndNormalizeClusterDescriptionInfoV2();
432424
})().finally(() => {
433425
delete this.loadAllPromise;
434426
});

packages/compass-web/src/entrypoint.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ const WithConnectionsStore: React.FunctionComponent<{
234234
useEffect(() => {
235235
const intervalId = setInterval(() => {
236236
void actions.refreshConnections();
237-
}, /* Matches default polling intervals in mms codebase */ 60_000);
237+
}, /* Matches default polling intervals in mms codebase */ 5_000);
238238
return () => {
239239
clearInterval(intervalId);
240240
};

0 commit comments

Comments
 (0)