Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: more auto-update logging, disable if not supported COMPASS-7220 #4868

Merged
merged 3 commits into from
Sep 20, 2023

Conversation

lerouxb
Copy link
Contributor

@lerouxb lerouxb commented Sep 19, 2023

Working theory:

  • the autoUpdates preference starts as disabled
  • once preferences are loaded it transitions to enabled
  • because it became enabled we transition to AutoUpdateManagerState.CheckingForUpdates
  • this then kicks off the check which finds that there is an update available

This change:

  • logs whether updates are supported or enabled up front (we were already logging enabled true/false, but likely too late).
  • won't register the preference change event handler or enable the autoUpdater based on the preference at all if it is not supported
  • logs if autoUpdate is not supported
  • logs when the preference changes and we either kick off another check or disable

@lerouxb
Copy link
Contributor Author

lerouxb commented Sep 19, 2023

Sample .msi logs:

{"t":{"$date":"2023-09-19T12:12:31.898Z"},"s":"I","c":"COMPASS-MAIN","id":1001000001,"ctx":"logging","msg":"Starting logging","attr":{"version":"0.0.1-dev.0","nodeVersion":"18.16.1","electronVersion":"26.2.1","chromeVersion":"116.0.5845.188","platform":"win32","arch":"x64","osReleaseName":null,"osReleaseVersion":null,"pendingEarlyLogEventCount":3}}
{"t":{"$date":"2023-09-19T12:12:31.746Z"},"s":"I","c":"COMPASS-PREFERENCES","id":1001000153,"ctx":"preferences","msg":"Skipping global configuration file due to error","attr":{"filename":"C:\\Program Files\\mongodb-compass.cfg","error":"ENOENT: no such file or directory, open 'C:\\Program Files\\mongodb-compass.cfg'","code":"ENOENT"}}
{"t":{"$date":"2023-09-19T12:12:31.749Z"},"s":"I","c":"COMPASS-PREFERENCES","id":1001000158,"ctx":"preferences","msg":"Parsed command line flags","attr":{"options":["_"]}}
{"t":{"$date":"2023-09-19T12:12:31.868Z"},"s":"E","c":"COMPASS-USER-STORAGE","id":1001000234,"ctx":"Filesystem","msg":"Error reading file","attr":{"path":"C:\\Users\\Administrator\\AppData\\Roaming\\MongoDB Compass Dev\\AppPreferences\\General.json","error":"ENOENT: no such file or directory, open 'C:\\Users\\Administrator\\AppData\\Roaming\\MongoDB Compass Dev\\AppPreferences\\General.json'"}}
{"t":{"$date":"2023-09-19T12:12:31.901Z"},"s":"I","c":"COMPASS-MAIN","id":1001000169,"ctx":"Protocol handling","msg":"Modifying protocol handlers","attr":{"action":"install","protocols":null}}
{"t":{"$date":"2023-09-19T12:12:33.600Z"},"s":"I","c":"COMPASS-ATLAS-SERVICE","id":1001000210,"ctx":"AtlasService","msg":"Atlas service initialized","attr":{"config":{"atlasApiBaseUrl":"https://compass.mongodb.com","atlasLogin":{"clientId":"0oajzdcznmE8GEyio297","issuer":"https://auth.mongodb.com/oauth2/default"},"authPortalUrl":"https://account.mongodb.com/account/login"}}}
{"t":{"$date":"2023-09-19T12:12:33.600Z"},"s":"I","c":"COMPASS-AUTO-UPDATES","id":1001000130,"ctx":"AutoUpdateManager","msg":"Initializing"}
{"t":{"$date":"2023-09-19T12:12:33.601Z"},"s":"I","c":"COMPASS-AUTO-UPDATES","id":1001000133,"ctx":"AutoUpdateManager","msg":"Setting up updateManager","attr":{"endpoint":"https://compass.mongodb.com","product":"compass","channel":"dev","platform":"win32","arch":"x64","version":"0.0.1-dev.0","updateCheckInterval":14400000,"initialUpdateDelay":30000,"supported":false,"enabled":false}}
{"t":{"$date":"2023-09-19T12:12:33.601Z"},"s":"I","c":"COMPASS-AUTO-UPDATES","id":1001000247,"ctx":"AutoUpdateManager","msg":"autoUpdate not supported'}"}
{"t":{"$date":"2023-09-19T12:12:33.601Z"},"s":"I","c":"COMPASS-AUTO-UPDATES","id":1001000162,"ctx":"AutoUpdateManager","msg":"Disabling auto updates"}
{"t":{"$date":"2023-09-19T12:12:33.602Z"},"s":"I","c":"COMPASS-ATLAS-SERVICE","id":1001000227,"ctx":"AtlasService","msg":"Fetching if the AI feature is enabled"}
{"t":{"$date":"2023-09-19T12:12:33.602Z"},"s":"I","c":"COMPASS-MAIN","id":1001000125,"ctx":"AutoEncryption","msg":"Found MongoDB Crypt library","attr":{"cryptSharedLibPath":"C:\\Program Files\\MongoDB Compass Dev\\resources\\app.asar.unpacked\\build\\assets\\mongo_crypt_v1.1dfd0045ca481c345ce8.dll","externalOverride":null}}
{"t":{"$date":"2023-09-19T12:12:33.685Z"},"s":"E","c":"COMPASS-ATLAS-SERVICE","id":1001000244,"ctx":"AtlasService","msg":"Failed to load if the AI feature is enabled","attr":{"error":"NetworkError: 404 Not Found\n    at _e (C:\\Program Files\\MongoDB Compass Dev\\resources\\app.asar\\build\\959.js:1:21682)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async Fe.getAIFeatureEnablement (C:\\Program Files\\MongoDB Compass Dev\\resources\\app.asar\\build\\959.js:1:28397)\n    at async Fe.setupAIAccess (C:\\Program Files\\MongoDB Compass Dev\\resources\\app.asar\\build\\959.js:1:28704)\n    at async C:\\Program Files\\MongoDB Compass Dev\\resources\\app.asar\\build\\959.js:1:23928\n    at async Ze.setupAtlasService (C:\\Program Files\\MongoDB Compass Dev\\resources\\app.asar\\build\\959.js:1:37159)"}}
{"t":{"$date":"2023-09-19T12:12:33.686Z"},"s":"W","c":"OIDC-PLUGIN","id":1002000016,"ctx":"AtlasService-oidc","msg":"Authentication failed","attr":{"error":"Auth flows are not allowed when sign in is not triggered by user"}}
{"t":{"$date":"2023-09-19T12:12:33.971Z"},"s":"E","c":"COMPASS-ATLAS-SERVICE","id":1001000225,"ctx":"AtlasService","msg":"Failed to restore state","attr":{"error":"NetworkError: 401 Unauthorized\n    at _e (C:\\Program Files\\MongoDB Compass Dev\\resources\\app.asar\\build\\959.js:1:21682)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async C:\\Program Files\\MongoDB Compass Dev\\resources\\app.asar\\build\\959.js:1:26851\n    at async Fe.getUserInfo (C:\\Program Files\\MongoDB Compass Dev\\resources\\app.asar\\build\\959.js:1:26644)\n    at async C:\\Program Files\\MongoDB Compass Dev\\resources\\app.asar\\build\\959.js:1:23959\n    at async Ze.setupAtlasService (C:\\Program Files\\MongoDB Compass Dev\\resources\\app.asar\\build\\959.js:1:37159)"}}
{"t":{"$date":"2023-09-19T12:12:35.484Z"},"s":"I","c":"COMPASS-PLUGINS","id":1001000141,"ctx":"Hadron Plugin Manager","msg":"Loading plugins from path C:\\Users\\Administrator\\.mongodb\\compass\\plugins"}
{"t":{"$date":"2023-09-19T12:12:35.488Z"},"s":"I","c":"COMPASS-PLUGINS","id":1001000242,"ctx":"Hadron Plugin Manager","msg":"Plugin folder does not exist, no plugins loaded.","attr":{"path":"C:\\Users\\Administrator\\.mongodb\\compass\\plugins"}}
{"t":{"$date":"2023-09-19T12:12:35.499Z"},"s":"I","c":"COMPASS-INTERCOM","id":1001000113,"ctx":"Intercom","msg":"Unloading intercom script"}
{"t":{"$date":"2023-09-19T12:12:35.499Z"},"s":"W","c":"COMPASS-INTERCOM","id":1001000114,"ctx":"Intercom","msg":"Intercom script unloaded"}
{"t":{"$date":"2023-09-19T12:12:35.501Z"},"s":"I","c":"COMPASS-APP","id":1001000092,"ctx":"Main Window","msg":"Rendering app container","attr":{"autoConnectEnabled":false}}
{"t":{"$date":"2023-09-19T12:12:35.557Z"},"s":"I","c":"COMPASS-TELEMETRY","id":1001000094,"ctx":"Telemetry","msg":"Enabling Telemetry reporting"}
{"t":{"$date":"2023-09-19T12:12:35.557Z"},"s":"I","c":"COMPASS-TELEMETRY","id":1001000093,"ctx":"Telemetry","msg":"Loading telemetry config","attr":{"telemetryCapableEnvironment":true,"hasAnalytics":true,"currentUserId":null,"telemetryAnonymousId":"e4c4b97c-7f0d-49b6-9e58-d7acc89f17bc","state":"enabled","queuedEvents":0}}
{"t":{"$date":"2023-09-19T12:12:35.608Z"},"s":"W","c":"OIDC-PLUGIN","id":1002000016,"ctx":"AtlasService-oidc","msg":"Authentication failed","attr":{"error":"Auth flows are not allowed when sign in is not triggered by user"}}
{"t":{"$date":"2023-09-19T12:12:35.610Z"},"s":"W","c":"OIDC-PLUGIN","id":1002000016,"ctx":"AtlasService-oidc","msg":"Authentication failed","attr":{"error":"Auth flows are not allowed when sign in is not triggered by user"}}
{"t":{"$date":"2023-09-19T12:12:35.628Z"},"s":"I","c":"COMPASS-INTERCOM","id":1001000116,"ctx":"Intercom","msg":"Loading intercom script"}
{"t":{"$date":"2023-09-19T12:12:35.629Z"},"s":"I","c":"COMPASS-INTERCOM","id":1001000111,"ctx":"Intercom","msg":"Intercom booted with metadata","attr":{"user_id":"e4c4b97c-7f0d-49b6-9e58-d7acc89f17bc","app_id":"p57suhg7","created_at":1695125551,"app_name":"MongoDB Compass Dev","app_version":"0.0.1-dev.0","app_stage":"production"}}

@lerouxb
Copy link
Contributor Author

lerouxb commented Sep 19, 2023

Sample .zip log:

{"t":{"$date":"2023-09-19T12:15:02.433Z"},"s":"I","c":"COMPASS-MAIN","id":1001000001,"ctx":"logging","msg":"Starting logging","attr":{"version":"0.0.1-dev.0","nodeVersion":"18.16.1","electronVersion":"26.2.1","chromeVersion":"116.0.5845.188","platform":"win32","arch":"x64","osReleaseName":null,"osReleaseVersion":null,"pendingEarlyLogEventCount":2}}
{"t":{"$date":"2023-09-19T12:15:02.294Z"},"s":"I","c":"COMPASS-PREFERENCES","id":1001000153,"ctx":"preferences","msg":"Skipping global configuration file due to error","attr":{"filename":"C:\\Users\\Administrator\\Downloads\\mongodb-compass.cfg","error":"ENOENT: no such file or directory, open 'C:\\Users\\Administrator\\Downloads\\mongodb-compass.cfg'","code":"ENOENT"}}
{"t":{"$date":"2023-09-19T12:15:02.297Z"},"s":"I","c":"COMPASS-PREFERENCES","id":1001000158,"ctx":"preferences","msg":"Parsed command line flags","attr":{"options":["_"]}}
{"t":{"$date":"2023-09-19T12:15:02.436Z"},"s":"I","c":"COMPASS-TELEMETRY","id":1001000094,"ctx":"Telemetry","msg":"Enabling Telemetry reporting"}
{"t":{"$date":"2023-09-19T12:15:02.436Z"},"s":"I","c":"COMPASS-TELEMETRY","id":1001000093,"ctx":"Telemetry","msg":"Loading telemetry config","attr":{"telemetryCapableEnvironment":true,"hasAnalytics":true,"currentUserId":null,"telemetryAnonymousId":"e4c4b97c-7f0d-49b6-9e58-d7acc89f17bc","state":"enabled","queuedEvents":0}}
{"t":{"$date":"2023-09-19T12:15:02.472Z"},"s":"I","c":"COMPASS-MAIN","id":1001000169,"ctx":"Protocol handling","msg":"Modifying protocol handlers","attr":{"action":"install","protocols":null}}
{"t":{"$date":"2023-09-19T12:15:02.688Z"},"s":"I","c":"COMPASS-ATLAS-SERVICE","id":1001000210,"ctx":"AtlasService","msg":"Atlas service initialized","attr":{"config":{"atlasApiBaseUrl":"https://compass.mongodb.com","atlasLogin":{"clientId":"0oajzdcznmE8GEyio297","issuer":"https://auth.mongodb.com/oauth2/default"},"authPortalUrl":"https://account.mongodb.com/account/login"}}}
{"t":{"$date":"2023-09-19T12:15:02.688Z"},"s":"I","c":"COMPASS-AUTO-UPDATES","id":1001000130,"ctx":"AutoUpdateManager","msg":"Initializing"}
{"t":{"$date":"2023-09-19T12:15:02.688Z"},"s":"I","c":"COMPASS-AUTO-UPDATES","id":1001000133,"ctx":"AutoUpdateManager","msg":"Setting up updateManager","attr":{"endpoint":"https://compass.mongodb.com","product":"compass","channel":"dev","platform":"win32","arch":"x64","version":"0.0.1-dev.0","updateCheckInterval":14400000,"initialUpdateDelay":30000,"supported":false,"enabled":true}}
{"t":{"$date":"2023-09-19T12:15:02.688Z"},"s":"I","c":"COMPASS-AUTO-UPDATES","id":1001000247,"ctx":"AutoUpdateManager","msg":"autoUpdate not supported'}"}
{"t":{"$date":"2023-09-19T12:15:02.689Z"},"s":"I","c":"COMPASS-AUTO-UPDATES","id":1001000162,"ctx":"AutoUpdateManager","msg":"Disabling auto updates"}
{"t":{"$date":"2023-09-19T12:15:02.689Z"},"s":"I","c":"COMPASS-MAIN","id":1001000125,"ctx":"AutoEncryption","msg":"Found MongoDB Crypt library","attr":{"cryptSharedLibPath":"C:\\Users\\Administrator\\Downloads\\mongodb-compass-0.0.1-dev.0-win32-x64\\resources\\app.asar.unpacked\\build\\assets\\mongo_crypt_v1.1dfd0045ca481c345ce8.dll","externalOverride":null}}
{"t":{"$date":"2023-09-19T12:15:02.721Z"},"s":"I","c":"COMPASS-ATLAS-SERVICE","id":1001000227,"ctx":"AtlasService","msg":"Fetching if the AI feature is enabled"}
{"t":{"$date":"2023-09-19T12:15:02.756Z"},"s":"E","c":"COMPASS-ATLAS-SERVICE","id":1001000244,"ctx":"AtlasService","msg":"Failed to load if the AI feature is enabled","attr":{"error":"NetworkError: 404 Not Found\n    at _e (C:\\Users\\Administrator\\Downloads\\mongodb-compass-0.0.1-dev.0-win32-x64\\resources\\app.asar\\build\\959.js:1:21682)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async Fe.getAIFeatureEnablement (C:\\Users\\Administrator\\Downloads\\mongodb-compass-0.0.1-dev.0-win32-x64\\resources\\app.asar\\build\\959.js:1:28397)\n    at async Fe.setupAIAccess (C:\\Users\\Administrator\\Downloads\\mongodb-compass-0.0.1-dev.0-win32-x64\\resources\\app.asar\\build\\959.js:1:28704)\n    at async C:\\Users\\Administrator\\Downloads\\mongodb-compass-0.0.1-dev.0-win32-x64\\resources\\app.asar\\build\\959.js:1:23928\n    at async Ze.setupAtlasService (C:\\Users\\Administrator\\Downloads\\mongodb-compass-0.0.1-dev.0-win32-x64\\resources\\app.asar\\build\\959.js:1:37159)"}}
{"t":{"$date":"2023-09-19T12:15:02.756Z"},"s":"W","c":"OIDC-PLUGIN","id":1002000016,"ctx":"AtlasService-oidc","msg":"Authentication failed","attr":{"error":"Auth flows are not allowed when sign in is not triggered by user"}}
{"t":{"$date":"2023-09-19T12:15:03.019Z"},"s":"E","c":"COMPASS-ATLAS-SERVICE","id":1001000225,"ctx":"AtlasService","msg":"Failed to restore state","attr":{"error":"NetworkError: 401 Unauthorized\n    at _e (C:\\Users\\Administrator\\Downloads\\mongodb-compass-0.0.1-dev.0-win32-x64\\resources\\app.asar\\build\\959.js:1:21682)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async C:\\Users\\Administrator\\Downloads\\mongodb-compass-0.0.1-dev.0-win32-x64\\resources\\app.asar\\build\\959.js:1:26851\n    at async Fe.getUserInfo (C:\\Users\\Administrator\\Downloads\\mongodb-compass-0.0.1-dev.0-win32-x64\\resources\\app.asar\\build\\959.js:1:26644)\n    at async C:\\Users\\Administrator\\Downloads\\mongodb-compass-0.0.1-dev.0-win32-x64\\resources\\app.asar\\build\\959.js:1:23959\n    at async Ze.setupAtlasService (C:\\Users\\Administrator\\Downloads\\mongodb-compass-0.0.1-dev.0-win32-x64\\resources\\app.asar\\build\\959.js:1:37159)"}}
{"t":{"$date":"2023-09-19T12:15:04.575Z"},"s":"I","c":"COMPASS-PLUGINS","id":1001000141,"ctx":"Hadron Plugin Manager","msg":"Loading plugins from path C:\\Users\\Administrator\\.mongodb\\compass\\plugins"}
{"t":{"$date":"2023-09-19T12:15:04.580Z"},"s":"I","c":"COMPASS-PLUGINS","id":1001000242,"ctx":"Hadron Plugin Manager","msg":"Plugin folder does not exist, no plugins loaded.","attr":{"path":"C:\\Users\\Administrator\\.mongodb\\compass\\plugins"}}
{"t":{"$date":"2023-09-19T12:15:04.593Z"},"s":"I","c":"COMPASS-APP","id":1001000092,"ctx":"Main Window","msg":"Rendering app container","attr":{"autoConnectEnabled":false}}
{"t":{"$date":"2023-09-19T12:15:04.685Z"},"s":"I","c":"COMPASS-INTERCOM","id":1001000116,"ctx":"Intercom","msg":"Loading intercom script"}
{"t":{"$date":"2023-09-19T12:15:04.685Z"},"s":"I","c":"COMPASS-INTERCOM","id":1001000111,"ctx":"Intercom","msg":"Intercom booted with metadata","attr":{"user_id":"e4c4b97c-7f0d-49b6-9e58-d7acc89f17bc","app_id":"p57suhg7","created_at":1695125551,"app_name":"MongoDB Compass Dev","app_version":"0.0.1-dev.0","app_stage":"production"}}
{"t":{"$date":"2023-09-19T12:15:04.678Z"},"s":"W","c":"OIDC-PLUGIN","id":1002000016,"ctx":"AtlasService-oidc","msg":"Authentication failed","attr":{"error":"Auth flows are not allowed when sign in is not triggered by user"}}
{"t":{"$date":"2023-09-19T12:15:04.680Z"},"s":"W","c":"OIDC-PLUGIN","id":1002000016,"ctx":"AtlasService-oidc","msg":"Authentication failed","attr":{"error":"Auth flows are not allowed when sign in is not triggered by user"}}

@lerouxb
Copy link
Contributor Author

lerouxb commented Sep 19, 2023

Sample .exe logs:

{"t":{"$date":"2023-09-19T12:20:00.928Z"},"s":"I","c":"COMPASS-MAIN","id":1001000001,"ctx":"logging","msg":"Starting logging","attr":{"version":"0.0.1-dev.0","nodeVersion":"18.16.1","electronVersion":"26.2.1","chromeVersion":"116.0.5845.188","platform":"win32","arch":"x64","osReleaseName":null,"osReleaseVersion":null,"pendingEarlyLogEventCount":2}}
{"t":{"$date":"2023-09-19T12:20:00.785Z"},"s":"I","c":"COMPASS-PREFERENCES","id":1001000153,"ctx":"preferences","msg":"Skipping global configuration file due to error","attr":{"filename":"C:\\Users\\Administrator\\AppData\\Local\\MongoDBCompassDev\\mongodb-compass.cfg","error":"ENOENT: no such file or directory, open 'C:\\Users\\Administrator\\AppData\\Local\\MongoDBCompassDev\\mongodb-compass.cfg'","code":"ENOENT"}}
{"t":{"$date":"2023-09-19T12:20:00.789Z"},"s":"I","c":"COMPASS-PREFERENCES","id":1001000158,"ctx":"preferences","msg":"Parsed command line flags","attr":{"options":["_","squirrelFirstrun"]}}
{"t":{"$date":"2023-09-19T12:20:00.931Z"},"s":"I","c":"COMPASS-TELEMETRY","id":1001000094,"ctx":"Telemetry","msg":"Enabling Telemetry reporting"}
{"t":{"$date":"2023-09-19T12:20:00.931Z"},"s":"I","c":"COMPASS-TELEMETRY","id":1001000093,"ctx":"Telemetry","msg":"Loading telemetry config","attr":{"telemetryCapableEnvironment":true,"hasAnalytics":true,"currentUserId":null,"telemetryAnonymousId":"e4c4b97c-7f0d-49b6-9e58-d7acc89f17bc","state":"enabled","queuedEvents":0}}
{"t":{"$date":"2023-09-19T12:20:00.968Z"},"s":"I","c":"COMPASS-MAIN","id":1001000169,"ctx":"Protocol handling","msg":"Modifying protocol handlers","attr":{"action":"install","protocols":null}}
{"t":{"$date":"2023-09-19T12:20:01.274Z"},"s":"I","c":"COMPASS-ATLAS-SERVICE","id":1001000210,"ctx":"AtlasService","msg":"Atlas service initialized","attr":{"config":{"atlasApiBaseUrl":"https://compass.mongodb.com","atlasLogin":{"clientId":"0oajzdcznmE8GEyio297","issuer":"https://auth.mongodb.com/oauth2/default"},"authPortalUrl":"https://account.mongodb.com/account/login"}}}
{"t":{"$date":"2023-09-19T12:20:01.275Z"},"s":"I","c":"COMPASS-AUTO-UPDATES","id":1001000130,"ctx":"AutoUpdateManager","msg":"Initializing"}
{"t":{"$date":"2023-09-19T12:20:01.305Z"},"s":"I","c":"COMPASS-AUTO-UPDATES","id":1001000133,"ctx":"AutoUpdateManager","msg":"Setting up updateManager","attr":{"endpoint":"https://compass.mongodb.com","product":"compass","channel":"dev","platform":"win32","arch":"x64","version":"0.0.1-dev.0","updateCheckInterval":14400000,"initialUpdateDelay":30000,"supported":true,"enabled":true}}
{"t":{"$date":"2023-09-19T12:20:01.306Z"},"s":"I","c":"COMPASS-ATLAS-SERVICE","id":1001000227,"ctx":"AtlasService","msg":"Fetching if the AI feature is enabled"}
{"t":{"$date":"2023-09-19T12:20:01.307Z"},"s":"I","c":"COMPASS-MAIN","id":1001000125,"ctx":"AutoEncryption","msg":"Found MongoDB Crypt library","attr":{"cryptSharedLibPath":"C:\\Users\\Administrator\\AppData\\Local\\MongoDBCompassDev\\app-0.0.1-dev0\\resources\\app.asar.unpacked\\build\\assets\\mongo_crypt_v1.1dfd0045ca481c345ce8.dll","externalOverride":null}}
{"t":{"$date":"2023-09-19T12:20:01.376Z"},"s":"E","c":"COMPASS-ATLAS-SERVICE","id":1001000244,"ctx":"AtlasService","msg":"Failed to load if the AI feature is enabled","attr":{"error":"NetworkError: 404 Not Found\n    at _e (C:\\Users\\Administrator\\AppData\\Local\\MongoDBCompassDev\\app-0.0.1-dev0\\resources\\app.asar\\build\\959.js:1:21682)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async Fe.getAIFeatureEnablement (C:\\Users\\Administrator\\AppData\\Local\\MongoDBCompassDev\\app-0.0.1-dev0\\resources\\app.asar\\build\\959.js:1:28397)\n    at async Fe.setupAIAccess (C:\\Users\\Administrator\\AppData\\Local\\MongoDBCompassDev\\app-0.0.1-dev0\\resources\\app.asar\\build\\959.js:1:28704)\n    at async C:\\Users\\Administrator\\AppData\\Local\\MongoDBCompassDev\\app-0.0.1-dev0\\resources\\app.asar\\build\\959.js:1:23928\n    at async Ze.setupAtlasService (C:\\Users\\Administrator\\AppData\\Local\\MongoDBCompassDev\\app-0.0.1-dev0\\resources\\app.asar\\build\\959.js:1:37159)"}}
{"t":{"$date":"2023-09-19T12:20:01.376Z"},"s":"W","c":"OIDC-PLUGIN","id":1002000016,"ctx":"AtlasService-oidc","msg":"Authentication failed","attr":{"error":"Auth flows are not allowed when sign in is not triggered by user"}}
{"t":{"$date":"2023-09-19T12:20:01.658Z"},"s":"E","c":"COMPASS-ATLAS-SERVICE","id":1001000225,"ctx":"AtlasService","msg":"Failed to restore state","attr":{"error":"NetworkError: 401 Unauthorized\n    at _e (C:\\Users\\Administrator\\AppData\\Local\\MongoDBCompassDev\\app-0.0.1-dev0\\resources\\app.asar\\build\\959.js:1:21682)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async C:\\Users\\Administrator\\AppData\\Local\\MongoDBCompassDev\\app-0.0.1-dev0\\resources\\app.asar\\build\\959.js:1:26851\n    at async Fe.getUserInfo (C:\\Users\\Administrator\\AppData\\Local\\MongoDBCompassDev\\app-0.0.1-dev0\\resources\\app.asar\\build\\959.js:1:26644)\n    at async C:\\Users\\Administrator\\AppData\\Local\\MongoDBCompassDev\\app-0.0.1-dev0\\resources\\app.asar\\build\\959.js:1:23959\n    at async Ze.setupAtlasService (C:\\Users\\Administrator\\AppData\\Local\\MongoDBCompassDev\\app-0.0.1-dev0\\resources\\app.asar\\build\\959.js:1:37159)"}}
{"t":{"$date":"2023-09-19T12:20:08.508Z"},"s":"I","c":"COMPASS-PLUGINS","id":1001000141,"ctx":"Hadron Plugin Manager","msg":"Loading plugins from path C:\\Users\\Administrator\\.mongodb\\compass\\plugins"}
{"t":{"$date":"2023-09-19T12:20:08.514Z"},"s":"I","c":"COMPASS-PLUGINS","id":1001000242,"ctx":"Hadron Plugin Manager","msg":"Plugin folder does not exist, no plugins loaded.","attr":{"path":"C:\\Users\\Administrator\\.mongodb\\compass\\plugins"}}
{"t":{"$date":"2023-09-19T12:20:08.529Z"},"s":"I","c":"COMPASS-APP","id":1001000092,"ctx":"Main Window","msg":"Rendering app container","attr":{"autoConnectEnabled":false}}
{"t":{"$date":"2023-09-19T12:20:08.621Z"},"s":"I","c":"COMPASS-INTERCOM","id":1001000116,"ctx":"Intercom","msg":"Loading intercom script"}
{"t":{"$date":"2023-09-19T12:20:08.622Z"},"s":"I","c":"COMPASS-INTERCOM","id":1001000111,"ctx":"Intercom","msg":"Intercom booted with metadata","attr":{"user_id":"e4c4b97c-7f0d-49b6-9e58-d7acc89f17bc","app_id":"p57suhg7","created_at":1695125551,"app_name":"MongoDB Compass Dev","app_version":"0.0.1-dev.0","app_stage":"production"}}
{"t":{"$date":"2023-09-19T12:20:08.638Z"},"s":"W","c":"OIDC-PLUGIN","id":1002000016,"ctx":"AtlasService-oidc","msg":"Authentication failed","attr":{"error":"Auth flows are not allowed when sign in is not triggered by user"}}
{"t":{"$date":"2023-09-19T12:20:08.639Z"},"s":"W","c":"OIDC-PLUGIN","id":1002000016,"ctx":"AtlasService-oidc","msg":"Authentication failed","attr":{"error":"Auth flows are not allowed when sign in is not triggered by user"}}

Comment on lines +626 to +628
// TODO(COMPASS-7233): This is kinda pointless at the moment because the
// preferences start as disabled and then become enabled the moment they are
// loaded. Which would immediately kick off the state change.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think this is not a race condition and just a case for first-time compass run where some of those default properties are not set until we show the welcome modal first time

@lerouxb lerouxb merged commit 745ed4e into main Sep 20, 2023
6 checks passed
@lerouxb lerouxb deleted the autoupdate-preferences-logging branch September 20, 2023 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants