Repository navigation
Conversation
WalkthroughSaveTransientRequest now computes the target file pathname before saving and, after persisting the transient request via IPC, enqueues an Changes
Sequence Diagram(s)sequenceDiagram
participant UI as SaveTransientRequest (Renderer)
participant IPC as IPCMain
participant FS as FileSystem
participant Queue as TaskQueue
participant Watcher as FileWatcher
UI->>IPC: saveTransientRequest(payload, targetPathname)
IPC->>FS: write file at targetPathname
FS-->>IPC: write success
IPC-->>UI: save success
UI->>Queue: insertTaskIntoQueue({ type: "OPEN_REQUEST", uid, collectionUid, itemPathname, preview })
Queue-->>Watcher: task enqueued / watcher observes file change
Watcher->>UI: open request when file detected
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Screen.Recording.2026-02-06.at.12.36.52.PM.movBreaks for when there's more than one request. |
…sient-request-on-save-should-persist-in-tab
…ntRequest and middleware - Updated SaveTransientRequest component to include a preview property set to false when opening requests. - Modified task middleware to use the preview property from the task, defaulting to true if not provided. - Ensured consistency across newHttpRequest, newGrpcRequest, and newWsRequest actions by adding the preview property.
… of github.com:chirag-bruno/bruno into bugfix/transient-request-on-save-should-persist-in-tab
…ientRequest component
There was a problem hiding this comment.
Actionable comments posted: 0
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/middlewares/tasks/middleware.js (1)
27-50:⚠️ Potential issue | 🟠 MajorBug confirmed: tasks removed from queue regardless of whether target items are found.
Both task handlers exhibit the same pattern:
OPEN_REQUEST (lines 44-48):
removeTaskFromQueueis called outside theif (item)block, removing tasks even when the target pathname isn't found.OPEN_EXAMPLE (lines 87-89): Same issue—
removeTaskFromQueueis called outside the nested conditions that verify the example exists, removing tasks even when item or example isn't found.When multiple tasks target different items in the same collection, the first file event fires and removes all matching tasks by
collectionUid, leaving orphaned tasks that will never be processed. This explains "breaks for when there's more than one request."The proposed fix is correct: move
removeTaskFromQueueinside the successful match condition for each handler. For OPEN_REQUEST, move it insideif (item)(line 32-41). For OPEN_EXAMPLE, move it insideif (example)(lines 75-83).Note: Tasks that never find their target need eventual cleanup—consider adding a staleness/TTL mechanism or max-retry count to prevent unbounded queue growth.
🧹 Nitpick comments (1)
packages/bruno-app/src/components/SaveTransientRequest/index.js (1)
145-153:closeTabsis not awaited — verify this is intentional.
closeTabsis an async thunk (it deletes transient files from the filesystem). It's fire-and-forget here. Since the old transient file lives in the temp directory and the new file is in the target collection directory, ordering shouldn't matter. But if a future change moves the file instead of copying, the unawaited deletion could race with the file watcher.Optional: await closeTabs for safety
- dispatch(closeTabs({ tabUids: [item.uid] })); + await dispatch(closeTabs({ tabUids: [item.uid] }));
Description
When a request gets saved, auto open the request in a tab.
JIRA: https://usebruno.atlassian.net/browse/BRU-2615
Contribution Checklist:
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