Skip to content

fix: Treat a repeated override file path in a different case as a repeat on Windows - #2134

Merged
kinyoklion merged 1 commit into
mainfrom
rlamb/overrides-node-repeated-paths-case
Oct 30, 2026
Merged

kinyoklion merged 1 commit into
mainfrom
rlamb/overrides-node-repeated-paths-case

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Summary

The file-based override source drops a path that is listed more than once, so that the file's entries do not collide with themselves. The comparison was exact. On Windows, where file names ignore case, a path repeated in a different case (C:\overrides\a.json and c:\Overrides\A.JSON) survived, and every key in that file then failed as its own duplicate under the default fail handling, so the reload failed and no overrides from it applied.

On Windows the comparison now ignores case. Elsewhere it stays exact, because a case-sensitive file system can hold both names as different files. The platform is read from the platform data the SDK already reports (os.name of Windows), so the shared package does not depend on Node's process.

This is the gap that Bugbot found in the .NET port (launchdarkly/dotnet-core#367).

Tests

Two tests in createOverrideSource.test.ts set the platform's OS name. On Windows, a path repeated in a different case is dropped with the existing warning; this test fails without the change and fails again with it reverted. On Linux, paths that differ only in case are both kept. The sdk-server suite passes (1561 passed, 7 skipped), and lint and formatting are clean.

Opened from termag

SDK-3419


Note

Overview
File override path deduplication now treats paths that differ only by case as the same file when platformData().os.name is Windows, dropping repeats with the existing warning. On other platforms, deduplication stays case-sensitive so two paths can still refer to distinct files.

Implementation replaces indexOf-based filtering with a Set keyed by the path or its lowercase form on Windows. Tests add makeContextOn to mock OS name and cover Windows (drop + warn) vs Linux (keep both, no warn).

Reviewed by Cursor Bugbot for commit db5a4ab. Bugbot is set up for automated code reviews on this repo. Configure here.

…eat on Windows

The file-based override source drops a path listed more than once, so
that the file's entries are not duplicates of themselves. The comparison
was exact, so on Windows, where file names ignore case, a path repeated
in a different case survived and every key of that file failed as its
own duplicate under the default fail handling. On Windows the comparison
now ignores case; elsewhere it stays exact.
@kinyoklion

Copy link
Copy Markdown
Member Author

bugbot review

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25998 bytes
Compressed size limit: 44000
Uncompressed size: 167978 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 32220 bytes
Compressed size limit: 32500
Uncompressed size: 152548 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 34386 bytes
Compressed size limit: 35000
Uncompressed size: 122562 bytes

@kinyoklion

Copy link
Copy Markdown
Member Author

bugbot review

@cursor cursor Bot 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit db5a4ab. Configure here.

@kinyoklion
kinyoklion marked this pull request as ready for review October 29, 2026 21:26
@kinyoklion
kinyoklion requested a review from a team as a code owner October 29, 2026 21:26
@kinyoklion
kinyoklion merged commit d331546 into main Oct 30, 2026
69 checks passed
@kinyoklion
kinyoklion deleted the rlamb/overrides-node-repeated-paths-case branch October 30, 2026 20:48
@github-actions github-actions Bot mentioned this pull request Oct 30, 2026
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