Repository navigation
fix: Treat a repeated override file path in a different case as a repeat on Windows - #494
Open
kinyoklion wants to merge 1 commit into
Open
kinyoklion wants to merge 1 commit into
kinyoklion wants to merge 1 commit into
Conversation
…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.
Member
Author
|
bugbot review |
There was a problem hiding this comment.
✅ 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 ebaff4f. Configure here.
kinyoklion
marked this pull request as ready for review
October 30, 2026 23:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The file-based override source drops a path that is listed more than once (#477, released in 7.21.0), 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.jsonandc:\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 deduplication moves into
uniqueFilePaths, so both behaviors are tested on every platform.This is the gap that Bugbot found in the .NET port (launchdarkly/dotnet-core#367). The Node change is launchdarkly/js-core#2134.
Tests
TestUniqueFilePathsIgnoresCaseOnlyWhenFileNamesIgnoreCasechecks both modes directly. It fails with case folding disabled.TestFileSourceTreatsAPathRepeatedInDifferentCaseAsARepeatOnlyOnWindowsbuilds a source from two paths that differ in case: one path on Windows, both elsewhere.go test -race ./...passes andmake lintreports no issues.Opened from termag
SDK-3419
Note
Overview
Fixes file-based override sources on Windows where listing the same path twice with different casing (e.g.
C:\overrides\a.jsonandc:\Overrides\A.JSON) was not treated as a duplicate. That let the file load twice and triggered duplicate-key failures under default handling, so overrides could fail to apply.Path deduplication is moved into
uniqueFilePaths, which compares paths case-insensitively whenignoreCaseis true (enabled on Windows viaruntime.GOOS). On case-sensitive systems, comparison stays exact so two paths that differ only by case can still refer to different files.Tests cover both modes of
uniqueFilePathsand assert build-time behavior on Windows vs other platforms.Reviewed by Cursor Bugbot for commit ebaff4f. Bugbot is set up for automated code reviews on this repo. Configure here.