diff --git a/packages/bruno-electron/src/index.js b/packages/bruno-electron/src/index.js index ab62c48fef..256e252e35 100644 --- a/packages/bruno-electron/src/index.js +++ b/packages/bruno-electron/src/index.js @@ -202,11 +202,18 @@ app.on('ready', async () => { // Initialize system proxy cache early (non-blocking) const { fetchSystemProxy } = require('./store/system-proxy'); - waitForShellEnv().then(() => { - fetchSystemProxy().catch((err) => { - console.warn('Failed to initialize system proxy cache:', err); + + // Note: irrespective of the state of the shell, + // try to fetch the system proxy information + waitForShellEnv() + .catch((err) => { + console.warn('Shell env init failed:', err); + }) + .finally(() => { + fetchSystemProxy().catch((err) => { + console.warn('Failed to initialize system proxy cache:', err); + }); }); - }); Menu.setApplicationMenu(menu); const { maximized, x, y, width, height } = loadWindowState(); diff --git a/packages/bruno-electron/src/store/shell-env-state.js b/packages/bruno-electron/src/store/shell-env-state.js index 95773f8d18..285de0a9ec 100644 --- a/packages/bruno-electron/src/store/shell-env-state.js +++ b/packages/bruno-electron/src/store/shell-env-state.js @@ -2,6 +2,7 @@ const { initializeShellEnv: _initializeShellEnv } = require('@usebruno/requests' const TIMEOUT_MS = 60_000; +/** @type {null | Promise} */ let _promise = null; const _initWithTimeout = () => {