File tree Expand file tree Collapse file tree 6 files changed +35
-8
lines changed
compass-e2e-tests/helpers
compass-preferences-model/src Expand file tree Collapse file tree 6 files changed +35
-8
lines changed Original file line number Diff line number Diff line change 1
1
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.
3
3
4
4
## List of dependencies
5
5
Original file line number Diff line number Diff line change 6
6
> the tracking plan for the specific Compass version you can use the following
7
7
> URL: ` https://github.com/mongodb-js/compass/blob/<compass version>/docs/tracking-plan.md `
8
8
9
- Generated on Thu , May 22 , 2025
9
+ Generated on Fri , May 23 , 2025
10
10
11
11
## Table of Contents
12
12
Original file line number Diff line number Diff line change @@ -1818,18 +1818,21 @@ const connectWithOptions = (
1818
1818
connectionId : connectionInfo . id ,
1819
1819
} ) ;
1820
1820
1821
+ const { networkTraffic, showEndOfLifeConnectionModal } =
1822
+ preferences . getPreferences ( ) ;
1823
+
1821
1824
if (
1822
1825
getGenuineMongoDB ( connectionInfo . connectionOptions . connectionString )
1823
1826
. isGenuine === false
1824
1827
) {
1825
1828
dispatch ( showNonGenuineMongoDBWarningModal ( connectionInfo . id ) ) ;
1826
- } else if ( preferences . getPreferences ( ) . networkTraffic ) {
1829
+ } else if ( showEndOfLifeConnectionModal ) {
1827
1830
void dataService
1828
1831
. instance ( )
1829
1832
. then ( async ( instance ) => {
1830
1833
const { version } = instance . build ;
1831
1834
const latestEndOfLifeServerVersion =
1832
- await getLatestEndOfLifeServerVersion ( ) ;
1835
+ await getLatestEndOfLifeServerVersion ( networkTraffic ) ;
1833
1836
if ( isEndOfLifeVersion ( version , latestEndOfLifeServerVersion ) ) {
1834
1837
dispatch (
1835
1838
showEndOfLifeMongoDBWarningModal (
Original file line number Diff line number Diff line change @@ -13,7 +13,13 @@ const {
13
13
14
14
let latestEndOfLifeServerVersion : Promise < string > | null = null ;
15
15
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
+
17
23
if ( ! HADRON_AUTO_UPDATE_ENDPOINT ) {
18
24
log . debug (
19
25
mongoLogId ( 1_001_000_356 ) ,
@@ -68,7 +74,7 @@ export async function getLatestEndOfLifeServerVersion(): Promise<string> {
68
74
69
75
export function isEndOfLifeVersion (
70
76
version : string ,
71
- latestEndOfLifeServerVersion : string
77
+ latestEndOfLifeServerVersion = FALLBACK_END_OF_LIFE_SERVER_VERSION
72
78
) {
73
79
try {
74
80
const coercedVersion = semverCoerce ( version ) ;
Original file line number Diff line number Diff line change @@ -647,6 +647,9 @@ async function startCompassElectron(
647
647
// we disable the cues completely for the e2e tests
648
648
process . env . DISABLE_GUIDE_CUES = 'true' ;
649
649
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
+
650
653
const options = {
651
654
automationProtocol : 'webdriver' as const ,
652
655
capabilities : {
Original file line number Diff line number Diff line change @@ -104,10 +104,9 @@ export type UserConfigurablePreferences = PermanentFeatureFlags &
104
104
} ;
105
105
106
106
/**
107
- * Internally used preferences that are not configurable
107
+ * Internally used preferences that are not configurable by users.
108
108
*/
109
109
export type InternalUserPreferences = {
110
- // by users.
111
110
showedNetworkOptIn : boolean ; // Has the settings dialog been shown before.
112
111
id : string ;
113
112
cloudFeatureRolloutAccess ?: {
@@ -121,6 +120,7 @@ export type InternalUserPreferences = {
121
120
userCreatedAt : number ;
122
121
// TODO: Remove this as part of COMPASS-8970.
123
122
enableConnectInNewWindow : boolean ;
123
+ showEndOfLifeConnectionModal : boolean ;
124
124
} ;
125
125
126
126
// UserPreferences contains all preferences stored to disk.
@@ -440,6 +440,21 @@ export const storedUserPreferencesProps: Required<{
440
440
validator : z . boolean ( ) . default ( true ) ,
441
441
type : 'boolean' ,
442
442
} ,
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
+ } ,
443
458
/**
444
459
* Enable/disable the AI services. This is currently set
445
460
* in the atlas-service initialization where we make a request to the
You can’t perform that action at this time.
0 commit comments