Skip to content

fix(mount): show requests that failed to load in the collection overview - #8545

Merged
bijin-bruno merged 5 commits into
usebruno:mainfrom
chirag-bruno:fix/mountv2-not-loaded-pathname-size
Jul 9, 2026
Merged

bijin-bruno merged 5 commits into
usebruno:mainfrom
chirag-bruno:fix/mountv2-not-loaded-pathname-size

Conversation

@chirag-bruno

@chirag-bruno chirag-bruno commented Jul 9, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

When a request file fails to parse, it should appear in the "Following requests were not loaded" table in the collection overview. In several cases it didn't:

  • Mount v1 (legacy): the synchronous add path and the change path only console.error'd the parse failure and never emitted the item to the renderer, so the failed request silently disappeared from the tree.
  • Mount v2: reconcile dropped raw for errored items, so their size couldn't be derived.
  • Windows: the table computed the relative pathname by splitting on a hardcoded /, which never matches Windows \ paths — so the Pathname column rendered blank.

Changes

  • app/collection-watcher.js: both the synchronous add path and the change path now emit a partial item (error, partial, size, raw) on parse failure, matching the async worker path.
  • services/mount/manager.js: forward raw for errored items during reconcile.
  • services/mount/tree-builder.js: derive item size from raw and set it for every item.
  • components/CollectionSettings/Overview/RequestsNotLoaded: compute the relative pathname separator-agnostically (fixes the blank Pathname on Windows) and include errored items.

Summary by CodeRabbit

  • Bug Fixes
    • Improved the “not loaded” requests view to include error-flagged items.
    • Made the Pathname column show a consistent relative path.
    • Failed HTTP request files are now retained, with correct partial/error UI state.
    • Error cases now preserve original raw content, and request node sizes are computed more reliably.
    • The collections reducer now correctly syncs partial/loading/error/raw/size for seq updates and failed parses.
    • Request comparison is now resilient to transformation failures.
  • Tests
    • Added reducer tests for “failed parse” collection file-change handling.

@coderabbitai

coderabbitai Bot commented Jul 9, 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

Collection request parsing now propagates partial/error state through mount storage, reducer updates, sizing, and the failed-requests overview.

Changes

Error/raw propagation and UI display

Layer / File(s) Summary
Emit structured parse failures
packages/bruno-electron/src/app/collection-watcher.js
add() and change() parse-failure paths now build http-request file objects with error.message, partial: true, loading: false, raw, size, and UUID fields before emitting collection-tree updates.
Persist raw and derive request size
packages/bruno-electron/src/services/mount/manager.js, packages/bruno-electron/src/services/mount/tree-builder.js
MountManager.#reconcile now stores raw with error state, and tree-builder.js adds a size field from entry.raw while defaulting missing request data.
Handle partial/error file updates
packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js
collectionChangeFileEvent now has a dedicated partial/error branch, and seq-only updates also copy partial, loading, size, and error fields.
Guard comparisons and verify failed-parse recovery
packages/bruno-app/src/utils/collections/index.js, packages/bruno-app/src/providers/ReduxStore/slices/collections/file-mode.spec.js
Request comparison returns false when request transformation throws, and new tests cover failed parse handling, draft preservation, and recovery after valid saves.
Render failed requests in overview
packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js
Failed items are memoized with useMemo, errored entries are included, relative pathnames are normalized, and missing sizes render as '-'.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • usebruno/bruno#8258: The request-file update flow here also adds partial/error handling in the same collections pipeline.
  • usebruno/bruno#8531: Both changes propagate raw through mount and collections state handling.
  • usebruno/bruno#8514: Both touch mount-state reconciliation for parsed request files.

Suggested reviewers: helloanoop, lohit-bruno, bijin-bruno, naman-bruno, sid-bruno

Poem

A parse went sideways, bytes stayed near,
Raw data held its shape quite clear.
Errors found a place to stay,
Sizes joined the display,
And failed paths now read just right 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: surfacing failed-to-load requests in the collection overview.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ 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.

Caution

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

⚠️ Outside diff range comments (2)
packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js (1)

72-83: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Render filter diverges from itemsFailedLoading filter — use itemsFailedLoading for rendering.

The <tbody> maps over flattenedItems and filters with item?.partial && !item?.loading (line 73), but itemsFailedLoading (line 24) also checks item?.error. Currently both match because the tree-builder always sets partial: true alongside error, but this coupling is fragile. If the contract changes, the section would show with missing rows.

🛡️ Proposed fix: render from `itemsFailedLoading` directly
         <tbody>
-          {flattenedItems?.map((item, index) => (
-            item?.partial && !item?.loading ? (
+          {itemsFailedLoading?.map((item, index) => (
               <tr key={index} className="cursor-pointer" onClick={handleRequestClick(item)}>
                 <td className="py-1.5 px-3">
                   {toRelativePathname(item?.pathname, collection?.pathname)}
                 </td>
                 <td className="py-1.5 px-3">
                   {item?.size?.toFixed?.(2)}&nbsp;MB
                 </td>
               </tr>
-            ) : null
           ))}
         </tbody>
🤖 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/CollectionSettings/Overview/RequestsNotLoaded/index.js`
around lines 72 - 83, The rendering logic in RequestsNotLoaded is duplicating
the failure filter instead of using the existing itemsFailedLoading source.
Update the tbody map in the RequestsNotLoaded component to render directly from
itemsFailedLoading, and keep the row click/label behavior tied to
handleRequestClick, toRelativePathname, and the item fields already used there.
This keeps the displayed rows aligned with the failure criteria defined earlier
and avoids relying on the fragile partial/loading coupling.
packages/bruno-electron/src/app/collection-watcher.js (1)

576-615: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Guard against undefined content/fileStats in the change() catch block.

If fs.readFileSync or fs.statSync throws (e.g., file deleted between watcher events), content and fileStats remain undefined. The catch block then sets file.size = sizeInMB(undefined) → NaN and file.data.raw = undefined, which would render "NaN MB" in the RequestsNotLoaded UI.

🛡️ Proposed fix
     } catch (err) {
       file.data = {
         name: path.basename(pathname),
         type: 'http-request'
       };
       file.error = {
         message: err?.message
       };
       file.partial = true;
       file.loading = false;
-      file.size = sizeInMB(fileStats?.size);
-      file.data.raw = content;
+      file.size = fileStats ? sizeInMB(fileStats.size) : 0;
+      file.data.raw = content ?? null;
       hydrateRequestWithUuid(file.data, pathname);
       win.webContents.send('main:collection-tree-updated', 'change', file);
     }
🤖 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/app/collection-watcher.js` around lines 576 -
615, In the change() handler in collection-watcher.js, the catch block assumes
content and fileStats were populated even when fs.readFileSync or fs.statSync
fails, which can produce NaN size and undefined raw data. Update the error path
to guard those fields before assigning file.size and file.data.raw, using safe
fallbacks when content/fileStats are unavailable. Keep the fix localized to the
existing change flow and preserve hydrateRequestWithUuid and the
collection-tree-updated send behavior.
🧹 Nitpick comments (1)
packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js (1)

20-26: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Reuse flattenedItems in the memoized filter to avoid duplicate flattenItems call.

flattenItems(collection.items) is called at line 20 (unmemoized) and again inside the useMemo at line 23. Reuse the already-computed flattenedItems to avoid the duplicate traversal.

♻️ Proposed refactor
-  const flattenedItems = flattenItems(collection.items);
-
-  const itemsFailedLoading = useMemo(() => {
-    return flattenItems(collection.items)?.filter((item) => {
-      return (item?.partial && !item.loading) || (item?.error);
-    });
-  }, [collection.items]);
+  const flattenedItems = useMemo(() => flattenItems(collection.items), [collection.items]);
+
+  const itemsFailedLoading = useMemo(() => {
+    return flattenedItems?.filter((item) => {
+      return (item?.partial && !item.loading) || (item?.error);
+    });
+  }, [flattenedItems]);
🤖 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/CollectionSettings/Overview/RequestsNotLoaded/index.js`
around lines 20 - 26, The RequestsNotLoaded component is flattening collection
items twice, once for flattenedItems and again inside the useMemo filter. Update
the useMemo in RequestsNotLoaded/index.js to reuse the existing flattenedItems
value instead of calling flattenItems(collection.items) again. Keep the
dependency list aligned with the reused variable so the memo stays correct and
avoids duplicate traversal.
🤖 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.

Outside diff comments:
In
`@packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js`:
- Around line 72-83: The rendering logic in RequestsNotLoaded is duplicating the
failure filter instead of using the existing itemsFailedLoading source. Update
the tbody map in the RequestsNotLoaded component to render directly from
itemsFailedLoading, and keep the row click/label behavior tied to
handleRequestClick, toRelativePathname, and the item fields already used there.
This keeps the displayed rows aligned with the failure criteria defined earlier
and avoids relying on the fragile partial/loading coupling.

In `@packages/bruno-electron/src/app/collection-watcher.js`:
- Around line 576-615: In the change() handler in collection-watcher.js, the
catch block assumes content and fileStats were populated even when
fs.readFileSync or fs.statSync fails, which can produce NaN size and undefined
raw data. Update the error path to guard those fields before assigning file.size
and file.data.raw, using safe fallbacks when content/fileStats are unavailable.
Keep the fix localized to the existing change flow and preserve
hydrateRequestWithUuid and the collection-tree-updated send behavior.

---

Nitpick comments:
In
`@packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js`:
- Around line 20-26: The RequestsNotLoaded component is flattening collection
items twice, once for flattenedItems and again inside the useMemo filter. Update
the useMemo in RequestsNotLoaded/index.js to reuse the existing flattenedItems
value instead of calling flattenItems(collection.items) again. Keep the
dependency list aligned with the reused variable so the memo stays correct and
avoids duplicate traversal.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 49ad12a4-5ab8-4cce-8e81-064b398103e1

📥 Commits

Reviewing files that changed from the base of the PR and between d5b9d0a and e6e9498.

📒 Files selected for processing (4)
  • packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js
  • packages/bruno-electron/src/app/collection-watcher.js
  • packages/bruno-electron/src/services/mount/manager.js
  • packages/bruno-electron/src/services/mount/tree-builder.js

@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: 2

Caution

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

⚠️ Outside diff range comments (1)
packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js (1)

10-16: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Normalize toRelativePathname before slicing
packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js:10-16 — the current startsWith/slice logic breaks when pathname and collectionPathname use different separators, so Windows paths can fall back to the full pathname. Use path.relative(...) or normalize both inputs first.

🤖 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/CollectionSettings/Overview/RequestsNotLoaded/index.js`
around lines 10 - 16, The toRelativePathname helper is doing a direct
startsWith/slice on raw path strings, which breaks when pathname and
collectionPathname use different separators. Update toRelativePathname to
normalize both inputs first, or switch to path.relative, so
RequestsNotLoaded/index.js returns the correct relative path for Windows-style
paths as well as POSIX paths.
🧹 Nitpick comments (1)
packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js (1)

22-23: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid optional chaining on array-iterated items.

item comes from .filter() on an array, so it is always defined. Per coding guidelines, ?. should be avoided when it hides whether a value can genuinely be null. Same applies to item?.pathname and collection?.pathname on line 74, and item?.size on line 77 — collection is a required prop.

♻️ Proposed fix
-    return (item?.partial && !item.loading) || (item?.error);
+    return (item.partial && !item.loading) || item.error;

And on line 74:

-                {toRelativePathname(item?.pathname, collection?.pathname)}
+                {toRelativePathname(item.pathname, collection.pathname)}
🤖 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/CollectionSettings/Overview/RequestsNotLoaded/index.js`
around lines 22 - 23, Remove unnecessary optional chaining where the values are
guaranteed to exist. In RequestsNotLoaded, update the filter callback over
flattenItems(collection.items) to use item directly instead of
item?.partial/item?.error, and also replace item?.pathname,
collection?.pathname, and item?.size with direct property access in the same
component. Keep the logic unchanged, just align the RequestsNotLoaded component
with the guideline that array-iterated items and required props should not be
guarded with optional chaining.

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-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js`:
- Line 77: The size display in RequestsNotLoaded should not render the “MB”
suffix when item.size is missing, since item?.size?.toFixed?.(2) can be
undefined. Update the JSX in the RequestsNotLoaded component to conditionally
render the formatted size only when a value exists, and provide a clear fallback
for missing sizes so the label doesn’t show a blank number. Use the existing
item.size expression as the location to apply the guard.
- Around line 71-72: The list in RequestsNotLoaded uses the array index as the
React key, which is unstable when itemsFailedLoading changes order or content.
Update the map in the RequestsNotLoaded component to use a stable unique
identifier from each item, such as item.uid, while keeping the existing
handleRequestClick(item) behavior unchanged.

---

Outside diff comments:
In
`@packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js`:
- Around line 10-16: The toRelativePathname helper is doing a direct
startsWith/slice on raw path strings, which breaks when pathname and
collectionPathname use different separators. Update toRelativePathname to
normalize both inputs first, or switch to path.relative, so
RequestsNotLoaded/index.js returns the correct relative path for Windows-style
paths as well as POSIX paths.

---

Nitpick comments:
In
`@packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js`:
- Around line 22-23: Remove unnecessary optional chaining where the values are
guaranteed to exist. In RequestsNotLoaded, update the filter callback over
flattenItems(collection.items) to use item directly instead of
item?.partial/item?.error, and also replace item?.pathname,
collection?.pathname, and item?.size with direct property access in the same
component. Keep the logic unchanged, just align the RequestsNotLoaded component
with the guideline that array-iterated items and required props should not be
guarded with optional chaining.
🪄 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

Run ID: 835235f7-0ef7-479d-ad8c-11cba97b7a71

📥 Commits

Reviewing files that changed from the base of the PR and between e6e9498 and fc2d47e.

📒 Files selected for processing (2)
  • packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js
  • packages/bruno-electron/src/services/mount/tree-builder.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/bruno-electron/src/services/mount/tree-builder.js

@pull-request-size pull-request-size Bot added size/L and removed size/M labels Jul 9, 2026

@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 `@packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js`:
- Around line 2981-2990: The partial/error update path in the collections slice
is overwriting the existing item type with the watcher fallback from
file.data.type, which can बदल ws/grpc/graphql entries to http-request on parse
failures. Update the item merge logic in the collections reducer to preserve the
current item.type during the file.partial/file.error branch, while still
refreshing the other fields from file.data and file.meta.
🪄 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

Run ID: 27049083-be15-4cc9-a251-6f9d275d6816

📥 Commits

Reviewing files that changed from the base of the PR and between 2f86302 and 36da4a3.

📒 Files selected for processing (5)
  • packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/file-mode.spec.js
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js
  • packages/bruno-app/src/utils/collections/index.js
  • packages/bruno-electron/src/services/mount/tree-builder.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/bruno-electron/src/services/mount/tree-builder.js

@chirag-bruno
chirag-bruno force-pushed the fix/mountv2-not-loaded-pathname-size branch from 36da4a3 to 007bfd7 Compare July 9, 2026 13:25

@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 (1)
packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js (1)

2981-2999: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js:2981-3021 — Reset loading and size on recovery
item.loading and item.size are only refreshed in the file.partial || file.error branch. If a failed parse is followed by a normal change event, the item can stay stuck with the old loading state and size even though the file recovered. Clear loading and carry size through the success branches too.

🤖 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/index.js`
around lines 2981 - 2999, The item update logic in the collections slice is
leaving stale `loading` and `size` values after a file recovers from a
partial/error state. Update the main item refresh flow around
`areItemsTheSameExceptSeqUpdate` so `item.loading` is cleared and `item.size` is
kept in sync not only in the `file.partial || file.error` branch but also in the
normal success branches when applying `file.data` updates.
🤖 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-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js`:
- Around line 11-19: The prefix check in toRelativePathname is too loose and can
mis-slice paths when a pathname only shares a partial prefix with
collectionPathname. Update the logic in toRelativePathname to only treat it as a
match when the normalized paths are equal or the next character after
normalizedCollection is a “/” boundary, then keep the existing slice behavior
only for valid collection-descendant paths.

---

Outside diff comments:
In `@packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js`:
- Around line 2981-2999: The item update logic in the collections slice is
leaving stale `loading` and `size` values after a file recovers from a
partial/error state. Update the main item refresh flow around
`areItemsTheSameExceptSeqUpdate` so `item.loading` is cleared and `item.size` is
kept in sync not only in the `file.partial || file.error` branch but also in the
normal success branches when applying `file.data` updates.
🪄 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

Run ID: 25386dd7-014d-44bf-9f0d-943dbba2f75a

📥 Commits

Reviewing files that changed from the base of the PR and between 36da4a3 and 007bfd7.

📒 Files selected for processing (5)
  • packages/bruno-app/src/components/CollectionSettings/Overview/RequestsNotLoaded/index.js
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/file-mode.spec.js
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js
  • packages/bruno-app/src/utils/collections/index.js
  • packages/bruno-electron/src/services/mount/tree-builder.js
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/bruno-electron/src/services/mount/tree-builder.js
  • packages/bruno-app/src/utils/collections/index.js
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/file-mode.spec.js

bijin-bruno
bijin-bruno previously approved these changes Jul 9, 2026
@chirag-bruno
chirag-bruno force-pushed the fix/mountv2-not-loaded-pathname-size branch from a237d24 to e4ad9bc Compare July 9, 2026 17:18
cchirag added 5 commits July 9, 2026 22:50
Partial/errored requests were being dropped or mis-rendered:

- collection-watcher (v1): the synchronous add path and the change path only
  logged parse errors and never emitted the item, so failed requests never
  reached the renderer. Both now send a partial item, matching the async
  worker path.
- mount v2: reconcile dropped `raw` for errored items; it is now forwarded so
  the item's size can be derived, and size is set for every item.
- RequestsNotLoaded: the relative pathname is computed separator-agnostically
  so it renders on Windows, and errored items are included.
An errored request had no parsed `request`, so tree-builder set
`request: undefined`. The main->renderer payload is JSON round-tripped, which
drops undefined keys, so the item reached the renderer without a `request`
property and `isItemARequest` (which requires it) excluded it from the sidebar.
Give errored items an empty `request` object so they survive serialization and
render.

Also render the "not loaded" table from the same filtered list used for the
empty-state check, so errored items are listed consistently.
@chirag-bruno
chirag-bruno force-pushed the fix/mountv2-not-loaded-pathname-size branch from e4ad9bc to 8aafcb1 Compare July 9, 2026 17:20
@bijin-bruno
bijin-bruno merged commit 81f9a40 into usebruno:main Jul 9, 2026
14 of 16 checks passed
sid-bruno added a commit to sid-bruno/bruno that referenced this pull request Aug 21, 2026
* fix: handle missing location header in redirect error response (usebruno#7725)

* fix(request-panel)/websocket and grpc tooltip overflow fixed in request panel (usebruno#8544)

* fix(request-panel)/websocket and grpx tooltip overflow fixed in request panel

* added test ids and updated the locators for request panel icons

* test(auth): fix modified-indicator inherit spec test (usebruno#8550)

* test(auth): fix modified-indicator inherit spec test

* fix(locators): updated locators for inherit

* feat(description): file binary description implementation (usebruno#8434)

* Add description support to file body entries

Covers the UI table, FileEntry schema, .bru and .yml file persistence,
OpenCollection converters, and end-to-end tests.

* chore: update @opencollection/types to version 0.10.0 and adjust related code

* fix: ensure placeholder is displayed correctly in description editor

* fix: improve column resizing logic in EnvironmentVariablesTable

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* fix: remove unused import of FileEntry in body.ts

* feat: enhance file handling and selection logic in various components

* test: refactor file description tests for improved readability and structure

* refactor: streamline test setup for binary file selection

* test: improve comments for clarity in file body description tests

* refactor: simplify selection update logic in collections slice

---------

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* fix(mount): show requests that failed to load in the collection overview (usebruno#8545)

* fix(mount): show requests that failed to load in the collection overview

Partial/errored requests were being dropped or mis-rendered:

- collection-watcher (v1): the synchronous add path and the change path only
  logged parse errors and never emitted the item, so failed requests never
  reached the renderer. Both now send a partial item, matching the async
  worker path.
- mount v2: reconcile dropped `raw` for errored items; it is now forwarded so
  the item's size can be derived, and size is set for every item.
- RequestsNotLoaded: the relative pathname is computed separator-agnostically
  so it renders on Windows, and errored items are included.

* fix(mount): render v2 requests that failed to parse in the sidebar

An errored request had no parsed `request`, so tree-builder set
`request: undefined`. The main->renderer payload is JSON round-tripped, which
drops undefined keys, so the item reached the renderer without a `request`
property and `isItemARequest` (which requires it) excluded it from the sidebar.
Give errored items an empty `request` object so they survive serialization and
render.

Also render the "not loaded" table from the same filtered list used for the
empty-state check, so errored items are listed consistently.

* fix(mount): guard against NaN size and unstable keys for unloaded requests

* fix(mount): recover unloaded requests on valid re-parse without crashing the reducer

* feat(mount): moved the assignments in change reducer

---------

Co-authored-by: Chirag Chandrashekhar <[email protected]>

---------

Co-authored-by: Pragadesh-45 <[email protected]>
Co-authored-by: sachin-thakur-bruno <[email protected]>
Co-authored-by: Pooja <[email protected]>
Co-authored-by: Sid <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Chirag Chandrashekhar <[email protected]>
Co-authored-by: Chirag Chandrashekhar <[email protected]>
Co-authored-by: Bijin A B <[email protected]>
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