fix: update system proxy fetching to use finally#7652
fix: update system proxy fetching to use finally#7652bijin-bruno merged 2 commits intousebruno:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughSystem proxy cache initialization in the Electron app now always runs Changes
Sequence Diagram(s)(Skipped — changes are localized and do not introduce a multi-component new control flow requiring visualization.) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
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 |
There was a problem hiding this comment.
Pull request overview
This PR ensures the system proxy cache is fetched even if shell environment initialization fails (e.g., due to a timeout), by moving the proxy fetch into a finally handler.
Changes:
- Add a JSDoc type annotation for the internal shell env initialization promise.
- Update startup flow to call
fetchSystemProxy()in a.finally(...)afterwaitForShellEnv()settles (resolve or reject).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/bruno-electron/src/store/shell-env-state.js | Adds a JSDoc type for the memoized shell env init promise. |
| packages/bruno-electron/src/index.js | Switches proxy cache initialization to run in a finally so it executes even when shell env init fails. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/bruno-electron/src/index.js`:
- Around line 205-215: The call to waitForShellEnv() can reject (e.g., timeout)
and currently its rejection is unhandled; modify the chain around
waitForShellEnv().finally(... ) to add a .catch() handler on waitForShellEnv()
(or on the full promise chain) so rejections are swallowed or logged; ensure you
still call fetchSystemProxy() in finally and add a clear log inside the .catch()
referencing waitForShellEnv to report the error.
🪄 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: 99c41fc9-bb1e-4a9d-8d88-813e6ce3c22a
📒 Files selected for processing (2)
packages/bruno-electron/src/index.jspackages/bruno-electron/src/store/shell-env-state.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix: update system proxy fetching to use finally for improved reliability * Update packages/bruno-electron/src/index.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix: update system proxy fetching to use finally (#7652) * fix: update system proxy fetching to use finally for improved reliability * Update packages/bruno-electron/src/index.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: allow file selection in multipart form without entering a key first (#7640) * fix: close previous SSE connection before sending new request When resending an SSE (Server-Sent Events) request using Cmd+Enter, the previous connection was not being closed, causing connection leaks. Changes: - Add SSE cancellation logic to sendRequest action - checks for running stream and cancels it before sending new request - Add return to cancelRequest action to make it properly chainable - Simplify RequestTabPanel by removing duplicate cancel logic (now handled centrally in sendRequest) - Add SSE endpoints to test server for e2e testing - Add Playwright e2e test to verify SSE connection cancellation * fix: address PR review feedback for SSE connection cancellation - Use platform-aware modifier (Meta on macOS, Control on Linux/Windows) instead of hardcoded Meta+Enter for cross-platform CI compatibility - Replace waitForTimeout with expect.poll for deterministic assertions - Remove dead try/catch around cancelRequest (errors already swallowed by cancelRequest's internal .catch) * fix: updated the test to check of connectionIds --------- Co-authored-by: Sid <siddharth@usebruno.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Pooja <pooja@usebruno.com> Co-authored-by: Chirag Chandrashekhar <cchirag85@gmail.com>
* fix: update system proxy fetching to use finally for improved reliability * Update packages/bruno-electron/src/index.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Description
Move the
fetchSystemProxyto a finally block in case the shellenv sync fails after a timeout, it would still make sense for whatever proxy information is available to be picked up.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
Bug Fixes
Chores