Skip to content

fix: normalizePathSlashes should normalize multiple leading slashes #2186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 22, 2025

Conversation

artemmufazalov
Copy link
Member

@artemmufazalov artemmufazalov commented Apr 22, 2025

Multiple slashed could be if we run multi-cluster mode in dev.

.env:

REACT_APP_BACKEND=
REACT_APP_META_BACKEND=http://ui-dev-0.ydb.yandex.net/api/meta8780
META_YDB_BACKEND=

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
318 317 0 1 0

😟 No changes in tests. 😕

Bundle Size: ✅

Current: 83.36 MB | Main: 83.36 MB
Diff: +0.09 KB (0.00%)

✅ Bundle size unchanged.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

@artemmufazalov artemmufazalov requested a review from Copilot April 22, 2025 11:44
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the behavior of normalizePathSlashes to correctly normalize multiple leading slashes while preserving protocol double slashes.

  • Updated the regex in normalizePathSlashes to use a negative lookbehind to ignore protocol specifiers.
  • Added additional tests to verify behavior for both leading and protocol-based slashes.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/utils/index.ts Updated regex in normalizePathSlashes and added an explanatory comment.
src/utils/test/index.test.ts Added test cases for multiple leading slashes and for ensuring protocol slashes remain unchanged.
Comments suppressed due to low confidence (1)

src/utils/test/index.test.ts:32

  • There's a typo in the test description; 'shoudl' should be corrected to 'should'.
test('shoudl not replace double slashes near protocols (after a colon)'...

@artemmufazalov artemmufazalov added this pull request to the merge queue Apr 22, 2025
Merged via the queue into main with commit 3e09755 Apr 22, 2025
5 checks passed
@artemmufazalov artemmufazalov deleted the fix-normalize-slashes branch April 22, 2025 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants