Skip to content

fix: Large Response Warning download button functionality#6695

Merged
bijin-bruno merged 3 commits intousebruno:mainfrom
gopu-bruno:fix/large-response-warning-download-button
Jan 7, 2026
Merged

fix: Large Response Warning download button functionality#6695
bijin-bruno merged 3 commits intousebruno:mainfrom
gopu-bruno:fix/large-response-warning-download-button

Conversation

@gopu-bruno
Copy link
Collaborator

@gopu-bruno gopu-bruno commented Jan 6, 2026

Description

Fixes the Large Response Warning download button that was throwing errors when trying to save large responses.

Related Issue

Fixes #5885
Fixes #6712

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

    • Downloads now return explicit success/cancel status so the app can confirm outcomes.
  • Improvements

    • UI updated: button title and label changed from "Save response to file" to "Download response to file".
    • Success toast shown only for successful downloads; cancelled/failed downloads no longer show a success message.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

Walkthrough

Refactors response download flow: UI handler renamed to downloadResponseToFile, passes item.pathname to IPC, and shows success toast only when IPC returns { success: true }. Electron IPC renderer:save-response-to-file now returns structured results for success or cancellation.

Changes

Cohort / File(s) Summary
React Response Download UI
packages/bruno-app/src/components/ResponsePane/LargeResponseWarning/index.js, packages/bruno-app/src/components/ResponsePane/ResponseDownload/index.js
Renamed handler to downloadResponseToFile; pass item.pathname (in addition to response and request URL) to IPC; early-return when response buffer missing; updated button title/label from "Save" to "Download"; show success toast only when result.success is truthy.
Electron IPC Handler
packages/bruno-electron/src/ipc/network/index.js
renderer:save-response-to-file now returns a structured result: { success: true, filePath } on success or { success: false, cancelled: true } on cancellation, replacing previous silent completion.

Sequence Diagram(s)

sequenceDiagram
    participant UI as Renderer UI
    participant IPC as Preload / IPC Bridge
    participant Main as Electron Main
    participant FS as File System

    UI->>IPC: invoke "renderer:save-response-to-file"(dataBuffer, requestUrl?, pathname?)
    IPC->>Main: forward save request (dataBuffer, suggestedPath)
    Main->>FS: write file at path
    alt write succeeded
        Main-->>IPC: { success: true, filePath }
        IPC-->>UI: { success: true, filePath }
        Note right of UI `#bbf7d0`: UI shows "Response downloaded to file" toast
    else user cancelled or failed
        Main-->>IPC: { success: false, cancelled: true }
        IPC-->>UI: { success: false, cancelled: true }
        Note right of UI `#ffe4b5`: UI does not show success toast
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

size/M

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • naman-bruno
  • bijin-bruno

Poem

💾 A button renamed, a clearer call,
IPC returns truth to tell it all,
Toasts now sing when downloads finish true,
Cancellations pass without ado,
Large responses saved — bravo to you 🎉

🚥 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 accurately describes the primary change: fixing the Large Response Warning download button functionality.
Linked Issues check ✅ Passed Changes address both linked issues (#5885, #6712) by fixing the download/save button error handling and return value contracts for large responses.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the Large Response Warning download button as specified in linked issues; no extraneous modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@gopu-bruno gopu-bruno force-pushed the fix/large-response-warning-download-button branch from e99204e to e2c52eb Compare January 7, 2026 09:33
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/bruno-electron/src/ipc/network/index.js (1)

1663-1726: Consider error handling consistency.

The handler resolves with structured objects for success and cancellation but rejects for errors (line 1724). While this works, callers must handle two patterns: checking .success for the happy path and using try-catch for errors.

For consistency, consider resolving with { success: false, error: error.message } instead of rejecting, though the current approach may be intentional to leverage promise rejection semantics.

Additionally, verify that:

  1. The UI layer properly handles all three scenarios (success, cancellation, error)
  2. The pathname parameter is always provided by callers (used at line 1709 without validation)
#!/bin/bash
# Verify UI handling of the new return structure

echo "=== Searching for callers of save-response-to-file IPC ==="
rg -nC3 --type=js --type=ts "save-response-to-file" -g '!**/node_modules/**' -g '!packages/bruno-electron/src/ipc/network/index.js'

echo -e "\n=== Looking for download/save button implementations ==="
rg -nC5 --type=js --type=ts "downloadResponseToFile|saveResponseToFile" -g '!**/node_modules/**'
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e99204e and 4ba1851.

📒 Files selected for processing (3)
  • packages/bruno-app/src/components/ResponsePane/LargeResponseWarning/index.js
  • packages/bruno-app/src/components/ResponsePane/ResponseDownload/index.js
  • packages/bruno-electron/src/ipc/network/index.js
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/bruno-app/src/components/ResponsePane/ResponseDownload/index.js
  • packages/bruno-app/src/components/ResponsePane/LargeResponseWarning/index.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions. () => {} is good
No space between function name and parentheses. func() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • packages/bruno-electron/src/ipc/network/index.js
🧠 Learnings (1)
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.

Applied to files:

  • packages/bruno-electron/src/ipc/network/index.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: SSL Tests - Linux
  • GitHub Check: Unit Tests
  • GitHub Check: CLI Tests
  • GitHub Check: SSL Tests - macOS
  • GitHub Check: Playwright E2E Tests
  • GitHub Check: SSL Tests - Windows
🔇 Additional comments (1)
packages/bruno-electron/src/ipc/network/index.js (1)

1720-1722: Structured return format improves error handling.

The new return format with { success: true, filePath } and { success: false, cancelled: true } allows the UI to properly distinguish between successful saves and user cancellations. This aligns well with the PR objective to fix the download button functionality.

@bijin-bruno bijin-bruno merged commit efe94d9 into usebruno:main Jan 7, 2026
8 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Feb 9, 2026
6 tasks
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.

Save button fails for large responses Large Response Warning Save Button Not Working - Little Save Button Still Does

2 participants