Skip to content

fix: bruno crash on request rename#6410

Merged
bijin-bruno merged 1 commit intousebruno:mainfrom
naman-bruno:bugfix/rename-crash
Dec 15, 2025
Merged

fix: bruno crash on request rename#6410
bijin-bruno merged 1 commit intousebruno:mainfrom
naman-bruno:bugfix/rename-crash

Conversation

@naman-bruno
Copy link
Collaborator

@naman-bruno naman-bruno commented Dec 15, 2025

Description

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

  • Refactor
    • Optimized request tab component performance by streamlining state management and eliminating overflow-detection logic to reduce unnecessary computations.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 15, 2025

Walkthrough

The RequestTab component was refactored to extract hasChanges and isWS constants computed from the item, remove duplicated hasChanges logic, and eliminate the overflow-detection useEffect block with its ResizeObserver and timeout mechanisms.

Changes

Cohort / File(s) Summary
RequestTab Refactoring
packages/bruno-app/src/components/RequestTabs/RequestTab/index.js
Extracted hasChanges and isWS constants; removed internal hasChanges duplication; removed overflow-detection useEffect and related ResizeObserver logic; reused new constants in rendering logic

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10–15 minutes

  • Attention points:
    • Verify that removal of overflow detection does not break tab UI behavior or introduce regressions in tab rendering
    • Confirm hasRequestChanges(item) function works as intended in place of the previous hasChanges computation
    • Ensure isWS constant is consistently applied in all middle-click and close-button logic paths

Suggested labels

size/XL

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • bijin-bruno

Poem

🧹 Constants rise, duplication falls,
ResizeObserver fades to dust,
Tab logic streamlined through the halls—
Simpler code? We've got your trust! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title claims to fix a 'bruno crash on request rename', but the changes only refactor RequestTab component logic by removing overflow detection and consolidating constants—no crash fix or rename-related logic is evident. Either update the title to accurately reflect the refactoring (e.g., 'refactor: simplify RequestTab state management and overflow detection'), or verify the PR description includes details on how these changes fix the crash.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

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-app/src/components/RequestTabs/RequestTab/index.js (1)

54-56: LGTM! Clean constant extraction following established patterns.

The hasChanges memoization is consistent with similar usages in QueryUrl, WsQueryUrl, and RequestTabMenu. Extracting these constants ensures they're computed once per render and used consistently throughout the component, which helps prevent potential race conditions during request rename operations.

Optional refinement: For consistency, you could memoize isWS as well:

-const isWS = item?.type === 'ws-request';
+const isWS = useMemo(() => item?.type === 'ws-request', [item?.type]);

However, since this is a trivial property access and comparison, the current approach is perfectly acceptable.

📜 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 c11266a and ac069fc.

📒 Files selected for processing (1)
  • packages/bruno-app/src/components/RequestTabs/RequestTab/index.js (1 hunks)
🧰 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-app/src/components/RequestTabs/RequestTab/index.js
🧬 Code graph analysis (1)
packages/bruno-app/src/components/RequestTabs/RequestTab/index.js (4)
packages/bruno-app/src/components/RequestTabs/ExampleTab/index.js (1)
  • hasChanges (23-23)
packages/bruno-app/src/components/RequestPane/QueryUrl/index.js (1)
  • hasChanges (40-40)
packages/bruno-app/src/components/RequestPane/WsQueryUrl/index.js (1)
  • hasChanges (44-44)
packages/bruno-app/src/utils/collections/index.js (2)
  • hasRequestChanges (1010-1026)
  • hasRequestChanges (1010-1026)
⏰ 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: CLI Tests
  • GitHub Check: Unit Tests
  • GitHub Check: Playwright E2E Tests
  • GitHub Check: SSL Tests - macOS
  • GitHub Check: SSL Tests - Linux
  • GitHub Check: SSL Tests - Windows

@bijin-bruno bijin-bruno merged commit 3d61106 into usebruno:main Dec 15, 2025
8 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Dec 18, 2025
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.

2 participants