fix(save-transient-request): allow filename-invalid characters in request display name by rudycelekli · Pull Request #9555 · usebruno/bruno · GitHub
Skip to content

fix(save-transient-request): allow filename-invalid characters in request display name - #9555

Open
rudycelekli wants to merge 1 commit into
usebruno:mainfrom
rudycelekli:fix/save-transient-request-name-validation-7686
Open

rudycelekli wants to merge 1 commit into
usebruno:mainfrom
rudycelekli:fix/save-transient-request-name-validation-7686

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 16, 2026 •

Copy link
Copy Markdown

Description

Saving a transient (untitled) request validated the display name against filename rules, so a name such as Get "quoted" user was rejected with a toast, while creating or renaming a request accepts it (only the derived filename is sanitized). It also overwrote the saved request's name with the sanitized filename.

Problem

Fixes #7686 — inconsistent request naming between the "Save Request" modal and the New Request / Rename flows.

Fix

In SaveTransientRequest: derive the filename with sanitizeName, validate that filename (so an unusable name such as only " is still rejected), and keep the user-entered name as the request's display name, matching the other flows. The electron handler already re-validates the filename.

Added a Playwright test that saves a transient request named Get "quoted" user and checks it appears with that name in the sidebar. It fails without the change and passes with it. Ran the whole transient-requests.spec.ts file (8 passed) and npm run lint (0 errors).

Screenshots

N/A (no visual change beyond the error toast no longer appearing).

Contribution Checklist:

  • I've used AI significantly to create this pull request (I reviewed the change and ran the tests locally)
  • 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.
  • I've run the claude code review skill locally.

Summary by CodeRabbit

  • Bug Fixes
    • Transient requests now retain the trimmed name users entered for display, including characters that are removed when creating a filesystem-safe filename.
    • Requests continue to use a sanitized filename, so display names can be more descriptive without affecting file naming.

…uest display name

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

@rahul05ranjan rahul05ranjan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This matches how create/rename already work, which is the right call. Verified against naming.ts in bruno-common: previously validateName(trimmedName) rejected any display name containing " (or other filename-invalid chars) before sanitizeName ever got a chance, even though the sanitized filename would have been perfectly usable on disk.

Also checked the edges:

  • A display name consisting only of invalid characters (e.g. ") sanitizes to an empty string, and validateName('') still returns false, so the empty-name toast still fires. Good.
  • The IPC handler re-validates the filename (filenameWithoutExt) and writeFileUnique resolves collisions with a numeric suffix, so the display-name/filename divergence can't silently overwrite an existing request.

The Playwright test covering the sidebar display name (including the cleanup so later tests see the same collection state) is a nice touch. Nothing else to flag.

This branch has not been deployed

No deployments
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.

Requirements for request naming are inconsistent

2 participants