fix: update system proxy fetching to use finally (#7652)

* fix: update system proxy fetching to use finally for improved reliability

* Update packages/bruno-electron/src/index.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Sid
2026-04-01 23:23:43 +05:30
committed by GitHub
parent c7ebe25cd6
commit ce87289616
2 changed files with 12 additions and 4 deletions

View File

@@ -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();

View File

@@ -2,6 +2,7 @@ const { initializeShellEnv: _initializeShellEnv } = require('@usebruno/requests'
const TIMEOUT_MS = 60_000;
/** @type {null | Promise<any>} */
let _promise = null;
const _initWithTimeout = () => {