From 34fcc5bbfbe16a8c885f63c84a0d28aec88d692a Mon Sep 17 00:00:00 2001 From: sanish-bruno Date: Tue, 16 Dec 2025 13:03:30 +0530 Subject: [PATCH] fix: init send event at the right time --- packages/bruno-electron/src/ipc/network/index.js | 16 ++++++++-------- .../hooks/api-integration/req/auth-timeout.bru | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/bruno-electron/src/ipc/network/index.js b/packages/bruno-electron/src/ipc/network/index.js index ec18046f7..a7a038750 100644 --- a/packages/bruno-electron/src/ipc/network/index.js +++ b/packages/bruno-electron/src/ipc/network/index.js @@ -1412,6 +1412,14 @@ const registerNetworkIpc = (mainWindow) => { folder = collection; } + mainWindow.webContents.send('main:run-folder-event', { + type: 'testrun-started', + isRecursive: recursive, + collectionUid, + folderUid, + cancelTokenUid + }); + // Create a map to store HookManagers for this collection/folder run // Key format: 'collection:', 'folder:', 'request:' const hookManagersMap = new Map(); @@ -1463,14 +1471,6 @@ const registerNetworkIpc = (mainWindow) => { await collectionHookManager.call(HOOK_EVENTS.RUNNER_BEFORE_COLLECTION_RUN, { collection, collectionUid }); } - mainWindow.webContents.send('main:run-folder-event', { - type: 'testrun-started', - isRecursive: recursive, - collectionUid, - folderUid, - cancelTokenUid - }); - try { let folderRequests = []; diff --git a/packages/bruno-tests/hooks-comprehensive-tests/hooks/api-integration/req/auth-timeout.bru b/packages/bruno-tests/hooks-comprehensive-tests/hooks/api-integration/req/auth-timeout.bru index a78c9440a..270c7ffb9 100644 --- a/packages/bruno-tests/hooks-comprehensive-tests/hooks/api-integration/req/auth-timeout.bru +++ b/packages/bruno-tests/hooks-comprehensive-tests/hooks/api-integration/req/auth-timeout.bru @@ -37,6 +37,8 @@ tests { }); test("req.getTimeout/setTimeout - manages timeout", function() { + const before = bru.getVar('timeout-before'); + expect(before).to.not.equal(10000); expect(bru.getVar('timeout-after')).to.equal(10000); });