Skip to content

fix(timeline): headers info in response timeline - #8766

Closed
shubh-bruno wants to merge 22 commits into
usebruno:mainfrom
shubh-bruno:fix/headers-info
Closed

shubh-bruno wants to merge 22 commits into
usebruno:mainfrom
shubh-bruno:fix/headers-info

Conversation

@shubh-bruno

@shubh-bruno shubh-bruno commented Jul 24, 2026 •

Copy link
Copy Markdown
Collaborator

Description

BRU-3731

Fixes - #645

Problem

Bruno adds default headers when sending a request (Accept, User-Agent, request-start-time, Accept-Encoding, Host, Connection), but the app does not show them fully, also it doesn't shows headers from respective entity table and scripts.

Solution

  • Backfill the transport headers from the real wire header block into the timeline after the response (hop-aware for redirects).
  • Add one shared helper (buildHeaderRows) that lists every sent header, ordered by source: default, collection, folder, request, script.
  • Render Request > Headers from that helper in all three surfaces, so defaults now show.
  • Reorder the Network log to the same order, so both views match.

Result: all six auto headers appear in Request > Headers and the Network log across all three surfaces, both views match, and they match a netcat/tcpdump capture.

Screenshot 2026-07-28 at 12 47 33 PM Screenshot 2026-07-28 at 12 47 41 PM Screenshot 2026-07-28 at 12 47 55 PM Screenshot 2026-07-28 at 12 47 58 PM

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Summary by CodeRabbit

  • New Features
    • Improved, source-attributed rendering of request/response headers across the expanded Request and Network views, with consistent ordering and richer “Request” headers.
    • Network timelines now reorder and align header rows to the derived request header sequence (including transport defaults).
  • Bug Fixes
    • Transport/request headers are more reliably captured and displayed in the network timeline.
    • Pre-request script header modifications are better attributed and shown.
    • Header table toggle shows the current header row count.
    • Request header input now supports safer array form updates.
  • Tests
    • Added Playwright coverage for “Timeline — response headers by source” across BRU and YAML fixtures.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The PR adds shared header-source resolution, captures transport and pre-request-script headers, orders timeline logs, updates Timeline and DevTools header rendering, adds cross-format Playwright coverage, and applies broad behavior-preserving let-to-const refactors.

Changes

Header provenance and timeline rendering

Layer / File(s) Summary
Shared header resolution
packages/bruno-common/src/utils/headers-source.js, packages/bruno-common/src/utils/index.ts, packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/Common/Headers/index.js
Header entries are normalized, stringified, prioritized, deduplicated, and rendered with row counts.
Request execution capture
packages/bruno-electron/src/ipc/network/*, packages/bruno-js/src/bruno-request.js
Pre-request script mutations and actually sent transport headers are added to timeline data, including array-based setHeaders support.
Timeline and DevTools wiring
packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/*, packages/bruno-app/src/components/Devtools/Console/RequestDetailsPanel/index.js
Request and Network views receive collection context, derive ordered header rows, and render reordered request-header logs.
End-to-end coverage
tests/response/timeline-headers/*, tests/utils/page/*
BRU and YAML fixtures and Playwright helpers validate source-ordered headers in Timeline and DevTools surfaces.

Behavior-preserving cleanup

Layer / File(s) Summary
Binding and comparison cleanup
packages/bruno-app/*, packages/bruno-common/*, packages/bruno-cli/*, packages/bruno-converters/*, tests/websockets/*
Local bindings and loop variables are changed to const, and selected type comparisons use strict equality without changing control flow.
Electron and collection utilities
packages/bruno-electron/src/app/*, packages/bruno-electron/src/ipc/collection.js, packages/bruno-electron/src/utils/*, packages/bruno-app/src/providers/ReduxStore/*, packages/bruno-app/src/utils/collections/*
Intermediate values, destructuring bindings, and iteration variables are made immutable while existing behavior is retained.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RequestRunner
  participant AxiosInterceptor
  participant Timeline
  participant HeaderResolver
  participant TimelineUI
  RequestRunner->>RequestRunner: Execute pre-request script
  RequestRunner->>AxiosInterceptor: Send request with scriptSetHeaders
  AxiosInterceptor->>Timeline: Record and backfill sent headers
  TimelineUI->>HeaderResolver: Resolve configured and timeline headers
  HeaderResolver-->>TimelineUI: Return ordered header rows
Loading

Possibly related PRs

Suggested reviewers: helloanoop, lohit-bruno

Poem

Headers march in source-bound rows,
Through scripts and transport flows.
Timeline lights each name and value,
DevTools shows the order true.
BRU and YAML test the way,
While const keeps clutter at bay.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing header information in the response timeline.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/bruno-electron/src/ipc/network/index.js (1)

1792-1799: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Runner path's requestSent is missing scriptSetHeaders.

The standalone runRequest path includes scriptSetHeaders: request.scriptSetHeaders || [] in its requestSent payload (line 992), but this Runner-flow requestSent (built from the same runPreRequest-populated request.scriptSetHeaders) omits it. Header-provenance attribution for pre-request-script-set headers will silently break for Collection Runner runs.

🐛 Proposed fix
             let requestSent = {
               url: request.url,
               method: request.method,
               headers: headersSent,
+              scriptSetHeaders: request.scriptSetHeaders || [],
               data: requestData,
               dataBuffer: requestDataBuffer,
               timestamp: Date.now()
             };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/bruno-electron/src/ipc/network/index.js` around lines 1792 - 1799,
Update the Runner-flow requestSent payload in the request execution path to
include scriptSetHeaders from request, defaulting to an empty array as in the
standalone runRequest payload. Preserve the existing requestSent fields and use
the runPreRequest-populated request.scriptSetHeaders value.
🧹 Nitpick comments (1)
packages/bruno-common/src/utils/headers-source.js (1)

1-108: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add the utility with the package TypeScript extension.

packages/bruno-common already has real TypeScript runtime source, tsconfig.json, and @rollup/plugin-typescript, so this new utility should be headers-source.ts with appropriate typed inputs/outputs instead of headers-source.js.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/bruno-common/src/utils/headers-source.js` around lines 1 - 108, The
new headers utility should use the TypeScript extension and typed interfaces
throughout. Rename the implementation to headers-source.ts, add appropriate
types for header entries, timeline entries, request data, collection/item
inputs, and buildHeaderRows inputs/outputs, and ensure the existing behavior
remains unchanged.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/bruno-electron/src/ipc/network/axios-instance.js`:
- Around line 234-273: Make redirect timelines hop-aware in backfillSentHeaders
at packages/bruno-electron/src/ipc/network/axios-instance.js:234-273 by
resetting the existing-header set and insertion boundary at the most recent
request marker, so only the current hop is scanned. Update sortRequestHeaderLogs
at
packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/Network/index.js:11-40
to split slots at each request entry and sort/reassign request headers
independently within each hop segment.
- Around line 238-255: Update parseSentHeaders to stop reading the private
ClientRequest._header field. Use an API-supported source or mechanism that
preserves the sent wire-header names and ordering for timeline backfill, while
retaining the existing fallback behavior only if it provides equivalent
wire-header data; do not rely on getHeaders() as a casing/order substitute.

In `@packages/bruno-js/src/bruno-request.js`:
- Around line 140-153: Update setHeaders in the array-form merge path to filter
out prototype-pollution keys (__proto__, constructor, and prototype) from each
script-supplied entry before merging into this.req.headers. Preserve merging of
all other valid header keys and the existing object-form replacement behavior.

---

Outside diff comments:
In `@packages/bruno-electron/src/ipc/network/index.js`:
- Around line 1792-1799: Update the Runner-flow requestSent payload in the
request execution path to include scriptSetHeaders from request, defaulting to
an empty array as in the standalone runRequest payload. Preserve the existing
requestSent fields and use the runPreRequest-populated request.scriptSetHeaders
value.

---

Nitpick comments:
In `@packages/bruno-common/src/utils/headers-source.js`:
- Around line 1-108: The new headers utility should use the TypeScript extension
and typed interfaces throughout. Rename the implementation to headers-source.ts,
add appropriate types for header entries, timeline entries, request data,
collection/item inputs, and buildHeaderRows inputs/outputs, and ensure the
existing behavior remains unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b516d0ab-9d59-43cc-9fda-77749788f80e

📥 Commits

Reviewing files that changed from the base of the PR and between 3c5b568 and 76fecd3.

📒 Files selected for processing (11)
  • packages/bruno-app/src/components/Devtools/Console/RequestDetailsPanel/index.js
  • packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/Common/Headers/index.js
  • packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/Network/index.js
  • packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/Request/index.js
  • packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/StyledWrapper.js
  • packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/index.js
  • packages/bruno-common/src/utils/headers-source.js
  • packages/bruno-common/src/utils/index.ts
  • packages/bruno-electron/src/ipc/network/axios-instance.js
  • packages/bruno-electron/src/ipc/network/index.js
  • packages/bruno-js/src/bruno-request.js

Comment thread packages/bruno-js/src/bruno-request.js Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/response/timeline-headers/timeline-headers.spec.ts`:
- Around line 119-135: Add a centralized locator for the header-name elements
using data-testid="tl-header-name", then assert their text content matches the
expected ordered sequence: DEFAULT_HEADERS followed by collection, folder,
request, and script headers. Keep the existing count and value assertions in the
current test steps.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1b5194f7-4249-447c-8bf3-efd65439d5ec

📥 Commits

Reviewing files that changed from the base of the PR and between 76fecd3 and 197470d.

📒 Files selected for processing (14)
  • packages/bruno-app/src/components/ResponsePane/Timeline/TimelineItem/Common/Headers/index.js
  • tests/response/timeline-headers/fixtures/collections/bru/bruno.json
  • tests/response/timeline-headers/fixtures/collections/bru/collection.bru
  • tests/response/timeline-headers/fixtures/collections/bru/folder-1/folder-2/folder.bru
  • tests/response/timeline-headers/fixtures/collections/bru/folder-1/folder-2/get-headers.bru
  • tests/response/timeline-headers/fixtures/collections/bru/folder-1/folder.bru
  • tests/response/timeline-headers/fixtures/collections/yml/folder-1/folder-2/folder.yml
  • tests/response/timeline-headers/fixtures/collections/yml/folder-1/folder-2/get-headers.yml
  • tests/response/timeline-headers/fixtures/collections/yml/folder-1/folder.yml
  • tests/response/timeline-headers/fixtures/collections/yml/opencollection.yml
  • tests/response/timeline-headers/timeline-headers.spec.ts
  • tests/utils/page/index.ts
  • tests/utils/page/locators.ts
  • tests/utils/page/timeline-headers.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js (1)

410-429: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Do not shadow the outer savePromises array.

The declaration at Line 410 creates a separate array, leaving the outer array from Line 401 empty. saveMultipleCollections can therefore resolve before any collection-save IPC call finishes.

Proposed fix
-        const savePromises = [];
+        const collectionSavePromises = [];

-        savePromises.push(ipcRenderer.invoke('renderer:save-collection-root', collectionCopy.pathname, collectionRootToSave, collectionCopy.brunoConfig));
+        collectionSavePromises.push(ipcRenderer.invoke('renderer:save-collection-root', collectionCopy.pathname, collectionRootToSave, collectionCopy.brunoConfig));

         if (collectionCopy.draft?.brunoConfig) {
-          savePromises.push(ipcRenderer.invoke('renderer:update-bruno-config', collectionCopy.draft.brunoConfig, collectionCopy.pathname, collectionCopy.root));
+          collectionSavePromises.push(ipcRenderer.invoke('renderer:update-bruno-config', collectionCopy.draft.brunoConfig, collectionCopy.pathname, collectionCopy.root));
         }

-        Promise.all(savePromises)
-          .then(() => {
-            dispatch(saveCollectionDraft({ collectionUid: collectionDraft.collectionUid }));
-          });
+        savePromises.push(
+          Promise.all(collectionSavePromises).then(() => {
+            dispatch(saveCollectionDraft({ collectionUid: collectionDraft.collectionUid }));
+          })
+        );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js`
around lines 410 - 429, Remove the inner savePromises declaration in the
collection-save branch and append IPC promises to the existing outer
savePromises array used by saveMultipleCollections. Ensure the final
Promise.all(savePromises) waits for every renderer:save-collection-root and
renderer:update-bruno-config invocation before resolving.
packages/bruno-app/src/utils/url/index.js (1)

4-12: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Insert version before any URL fragment.

For URLs such as /docs/ai#setup, this currently produces /docs/ai#setup?version=...; the parameter is part of the fragment and is never sent to the server. Split/preserve the hash before appending the query, and add coverage for query-plus-fragment URLs.

Proposed fix
 export const getDocsUrlWithVersion = (url) => {
-  const separator = url.includes('?') ? '&' : '?';
-  return `${url}${separator}version=${appVersion}`;
+  const hashIndex = url.indexOf('#');
+  const baseUrl = hashIndex === -1 ? url : url.slice(0, hashIndex);
+  const hash = hashIndex === -1 ? '' : url.slice(hashIndex);
+  const separator = baseUrl.includes('?') ? '&' : '?';
+  return `${baseUrl}${separator}version=${encodeURIComponent(appVersion)}${hash}`;
 };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/bruno-app/src/utils/url/index.js` around lines 4 - 12, Update
getDocsUrlWithVersion so it separates and preserves any URL hash before
determining the query separator and appending the version parameter, then
restores the fragment after the query. Add coverage for URLs containing both an
existing query and fragment, ensuring version is sent before the hash.
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/CodeView/index.js (1)

36-49: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Clear stale generated code when regeneration starts.

When language, item, or collection changes, snippet still contains the previous request until the async generation completes. Users can therefore view or copy code for the wrong request/language. Clear the state at effect start or render an explicit loading state.

Proposed fix
   const [snippet, setSnippet] = useState('');
   useEffect(() => {
     let cancelled = false;
+    setSnippet('');
     generateSnippet({
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/CodeView/index.js`
around lines 36 - 49, Clear the existing snippet at the start of the useEffect
that calls generateSnippet, before initiating the asynchronous request. Keep the
current cancellation guard so only the latest generation updates snippet when
language, item, collection, or interpolation preferences change.
🧹 Nitpick comments (3)
packages/bruno-app/src/utils/common/index.js (1)

558-567: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add focused tests for formatProxyTimestamp.

Cover the expected formatted output and invalid/edge timestamp inputs so locale-sensitive formatting does not regress. As per coding guidelines, meaningful behavior changes should include behavior-driven tests.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/bruno-app/src/utils/common/index.js` around lines 558 - 567, Add
focused behavior-driven tests for formatProxyTimestamp covering the expected
en-GB formatted output plus invalid and edge timestamp inputs. Use stable
assertions that verify the configured date, time, and 12-hour formatting without
making tests flaky across environments.

Source: Coding guidelines

packages/bruno-app/src/components/MultiLineEditor/index.js (1)

186-188: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a regression test for live placeholder updates.

Verify that changing placeholder updates the rendered CodeMirror placeholder without recreating the editor. As per coding guidelines, meaningful behavior changes should include behavior-driven tests.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/bruno-app/src/components/MultiLineEditor/index.js` around lines 186
- 188, Add a regression test for the MultiLineEditor component covering a
placeholder prop change after initial render. Assert that the rendered
CodeMirror placeholder updates to the new value while the existing editor
instance is preserved and not recreated.

Source: Coding guidelines

packages/bruno-app/src/utils/collections/index.js (1)

1238-1247: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add regression coverage for secret-variable precedence.

The changed logic makes interpolation and getVariableScope prefer the secret when enabled plain and secret variables share a name. Add a test asserting both paths return the same secret value. As per coding guidelines, meaningful behavior changes should include behavior-driven tests.

Also applies to: 1730-1734

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/bruno-app/src/utils/collections/index.js` around lines 1238 - 1247,
Add regression coverage for the enabled duplicate-name variable case in the
collection-variable test suite: configure one plain and one secret variable with
the same name, then assert both interpolation and getVariableScope return the
secret value. Keep the test focused on secret precedence and verify both access
paths produce the same result.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/bruno-electron/src/utils/filesystem.js`:
- Line 408: Update the targetPath construction to use path.join with destination
and path.basename(source), removing the hardcoded slash while preserving the
existing filename behavior.

---

Outside diff comments:
In
`@packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/CodeView/index.js`:
- Around line 36-49: Clear the existing snippet at the start of the useEffect
that calls generateSnippet, before initiating the asynchronous request. Keep the
current cancellation guard so only the latest generation updates snippet when
language, item, collection, or interpolation preferences change.

In `@packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js`:
- Around line 410-429: Remove the inner savePromises declaration in the
collection-save branch and append IPC promises to the existing outer
savePromises array used by saveMultipleCollections. Ensure the final
Promise.all(savePromises) waits for every renderer:save-collection-root and
renderer:update-bruno-config invocation before resolving.

In `@packages/bruno-app/src/utils/url/index.js`:
- Around line 4-12: Update getDocsUrlWithVersion so it separates and preserves
any URL hash before determining the query separator and appending the version
parameter, then restores the fragment after the query. Add coverage for URLs
containing both an existing query and fragment, ensuring version is sent before
the hash.

---

Nitpick comments:
In `@packages/bruno-app/src/components/MultiLineEditor/index.js`:
- Around line 186-188: Add a regression test for the MultiLineEditor component
covering a placeholder prop change after initial render. Assert that the
rendered CodeMirror placeholder updates to the new value while the existing
editor instance is preserved and not recreated.

In `@packages/bruno-app/src/utils/collections/index.js`:
- Around line 1238-1247: Add regression coverage for the enabled duplicate-name
variable case in the collection-variable test suite: configure one plain and one
secret variable with the same name, then assert both interpolation and
getVariableScope return the secret value. Keep the test focused on secret
precedence and verify both access paths produce the same result.

In `@packages/bruno-app/src/utils/common/index.js`:
- Around line 558-567: Add focused behavior-driven tests for
formatProxyTimestamp covering the expected en-GB formatted output plus invalid
and edge timestamp inputs. Use stable assertions that verify the configured
date, time, and 12-hour formatting without making tests flaky across
environments.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: be40c29e-d1e1-4527-9a12-4d72893f01f8

📥 Commits

Reviewing files that changed from the base of the PR and between 18db07b and 72a5258.

📒 Files selected for processing (22)
  • packages/bruno-app/src/components/CodeEditor/index.js
  • packages/bruno-app/src/components/MultiLineEditor/index.js
  • packages/bruno-app/src/components/RequestTabPanel/index.js
  • packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/GenerateCodeItem/CodeView/index.js
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
  • packages/bruno-app/src/utils/collections/index.js
  • packages/bruno-app/src/utils/common/index.js
  • packages/bruno-app/src/utils/url/index.js
  • packages/bruno-cli/src/runner/run-single-request.js
  • packages/bruno-common/src/generate-code/har/index.ts
  • packages/bruno-common/src/utils/index.ts
  • packages/bruno-converters/src/postman/bruno-to-postman.js
  • packages/bruno-converters/src/postman/postman-to-bruno.js
  • packages/bruno-electron/src/app/collection-watcher.js
  • packages/bruno-electron/src/ipc/collection.js
  • packages/bruno-electron/src/ipc/network/index.js
  • packages/bruno-electron/src/utils/collection.js
  • packages/bruno-electron/src/utils/filesystem.js
  • tests/utils/page/actions.ts
  • tests/utils/page/index.ts
  • tests/utils/page/locators.ts
  • tests/websockets/subproto.spec.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • tests/utils/page/index.ts
  • packages/bruno-common/src/utils/index.ts
  • tests/utils/page/locators.ts
  • tests/utils/page/actions.ts
  • packages/bruno-electron/src/ipc/network/index.js

@sid-bruno
sid-bruno marked this pull request as draft July 28, 2026 07:02
// Content-Length) after the request interceptor logged config.headers, so they're missing from the
// timeline. Read the real serialized header block off the ClientRequest and backfill the ones we
// didn't already log, inserted right after the existing request-header block so ordering holds.
const parseSentHeaders = (req) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please export parseSentHeaders and backfillSentHeaders and write unit tests for them.

Also, could you check with @sid-bruno whether backfillSentHeaders should be wrapped in a try...catch? Since this runs as part of the core request execution path, we probably don't want a bug in backfillSentHeaders to break the app

@sachin-thakur-bruno

Copy link
Copy Markdown
Collaborator

overall looks goods but suspecting one bug here not sure about it in case of re-directes.
Right now, the Headers Info table shows headers from the first request in the chain, not the one that actually got the response.
(headers-source.js:38-50, 86-90) just scans the whole log of everything that happened across all the redirects, and whenever it sees the same header name more than once, it keeps whichever one it saw first, which is always the original request, not the final redirected one.

@sachin-thakur-bruno sachin-thakur-bruno left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good and working fine locally.

@sid-bruno sid-bruno left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Possible blockers

@sid-bruno

Copy link
Copy Markdown
Collaborator

LGTM, will wait on tests and merge

@helloanoop

Copy link
Copy Markdown
Contributor

@bijin-bruno @sid-bruno Please hold off on merging this PR. I wanted to discuss a few items

@shubh-bruno

Copy link
Copy Markdown
Collaborator Author

Closing this pr will be creating new pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants