Skip to content

Commit 2c6b6fe

Browse files
authored
Merge branch 'main' into ci/update-electron
2 parents 6bcceee + 43a4832 commit 2c6b6fe

File tree

6 files changed

+35
-8
lines changed

6 files changed

+35
-8
lines changed

THIRD-PARTY-NOTICES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The following third-party software is used by and included in **Mongodb Compass**.
2-
This document was automatically generated on Thu May 22 2025.
2+
This document was automatically generated on Fri May 23 2025.
33

44
## List of dependencies
55

docs/tracking-plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
> the tracking plan for the specific Compass version you can use the following
77
> URL: `https://github.com/mongodb-js/compass/blob/<compass version>/docs/tracking-plan.md`
88
9-
Generated on Thu, May 22, 2025
9+
Generated on Fri, May 23, 2025
1010

1111
## Table of Contents
1212

packages/compass-connections/src/stores/connections-store-redux.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,18 +1818,21 @@ const connectWithOptions = (
18181818
connectionId: connectionInfo.id,
18191819
});
18201820

1821+
const { networkTraffic, showEndOfLifeConnectionModal } =
1822+
preferences.getPreferences();
1823+
18211824
if (
18221825
getGenuineMongoDB(connectionInfo.connectionOptions.connectionString)
18231826
.isGenuine === false
18241827
) {
18251828
dispatch(showNonGenuineMongoDBWarningModal(connectionInfo.id));
1826-
} else if (preferences.getPreferences().networkTraffic) {
1829+
} else if (showEndOfLifeConnectionModal) {
18271830
void dataService
18281831
.instance()
18291832
.then(async (instance) => {
18301833
const { version } = instance.build;
18311834
const latestEndOfLifeServerVersion =
1832-
await getLatestEndOfLifeServerVersion();
1835+
await getLatestEndOfLifeServerVersion(networkTraffic);
18331836
if (isEndOfLifeVersion(version, latestEndOfLifeServerVersion)) {
18341837
dispatch(
18351838
showEndOfLifeMongoDBWarningModal(

packages/compass-connections/src/utils/end-of-life-server.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ const {
1313

1414
let latestEndOfLifeServerVersion: Promise<string> | null = null;
1515

16-
export async function getLatestEndOfLifeServerVersion(): Promise<string> {
16+
export async function getLatestEndOfLifeServerVersion(
17+
allowNetworkRequests = true
18+
): Promise<string> {
19+
if (!allowNetworkRequests) {
20+
return FALLBACK_END_OF_LIFE_SERVER_VERSION;
21+
}
22+
1723
if (!HADRON_AUTO_UPDATE_ENDPOINT) {
1824
log.debug(
1925
mongoLogId(1_001_000_356),
@@ -68,7 +74,7 @@ export async function getLatestEndOfLifeServerVersion(): Promise<string> {
6874

6975
export function isEndOfLifeVersion(
7076
version: string,
71-
latestEndOfLifeServerVersion: string
77+
latestEndOfLifeServerVersion = FALLBACK_END_OF_LIFE_SERVER_VERSION
7278
) {
7379
try {
7480
const coercedVersion = semverCoerce(version);

packages/compass-e2e-tests/helpers/compass.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,9 @@ async function startCompassElectron(
647647
// we disable the cues completely for the e2e tests
648648
process.env.DISABLE_GUIDE_CUES = 'true';
649649

650+
// Making sure end-of-life connection modal is not shown, simplify any test connecting to such a server
651+
process.env.COMPASS_DISABLE_END_OF_LIFE_CONNECTION_MODAL = 'true';
652+
650653
const options = {
651654
automationProtocol: 'webdriver' as const,
652655
capabilities: {

packages/compass-preferences-model/src/preferences-schema.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,9 @@ export type UserConfigurablePreferences = PermanentFeatureFlags &
104104
};
105105

106106
/**
107-
* Internally used preferences that are not configurable
107+
* Internally used preferences that are not configurable by users.
108108
*/
109109
export type InternalUserPreferences = {
110-
// by users.
111110
showedNetworkOptIn: boolean; // Has the settings dialog been shown before.
112111
id: string;
113112
cloudFeatureRolloutAccess?: {
@@ -121,6 +120,7 @@ export type InternalUserPreferences = {
121120
userCreatedAt: number;
122121
// TODO: Remove this as part of COMPASS-8970.
123122
enableConnectInNewWindow: boolean;
123+
showEndOfLifeConnectionModal: boolean;
124124
};
125125

126126
// UserPreferences contains all preferences stored to disk.
@@ -440,6 +440,21 @@ export const storedUserPreferencesProps: Required<{
440440
validator: z.boolean().default(true),
441441
type: 'boolean',
442442
},
443+
/**
444+
* Show a modal when the user tries to connect to a server which has an end-of-life version.
445+
*/
446+
showEndOfLifeConnectionModal: {
447+
ui: false,
448+
cli: false,
449+
global: false,
450+
description: null,
451+
validator: z
452+
.boolean()
453+
.default(
454+
process.env.COMPASS_DISABLE_END_OF_LIFE_CONNECTION_MODAL !== 'true'
455+
),
456+
type: 'boolean',
457+
},
443458
/**
444459
* Enable/disable the AI services. This is currently set
445460
* in the atlas-service initialization where we make a request to the

0 commit comments

Comments
 (0)