Repository navigation
0.158.6: two file names that fold to one are refused - #83
Merged
Merged
Conversation
…ne name When two element ids of one type differ only in case (Ab1 and ab1, unnamed or both named Bob), the collision rule gave them file names that also differ only in case, and a case-insensitive disk (NTFS, APFS) kept one file for both: the folder held one element where the world had two. An unnamed id bob--x beside an element x named Bob was written as bob--x.json twice. Once the collision rule has chosen every name in a type folder, two names equal under the folder format's name fold, NFC then simple case folding (_fold_name, the archive reader's), now raise ValueError before anything is written, naming the type, both ids in code point order and both file names. The import doors and export_world write through write_folder. No name the rule chose before changes. The cases are shared byte for byte with the npm SDK (tests/fixtures/case-collide.cases.json, its sha256 held in the test). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
Fixed: two elements whose file names differ only in case are refused, where one of them was lost. The folder writer names a file from the element's id. When two ids of one type differ only in case (
Ab1andab1, unnamed or both namedBob), it gave them file names that also differ only in case, and a case-insensitive disk kept one file for both (measured on NTFS: one file for two elements). The writer now refuses, before any file is made, two final file names in one type folder that are one name under the folder format's name fold (NFC, then simple case folding, as the archive reader compares names), naming both ids. Also refused: an unnamed idbob--xbeside an elementxnamed Bob, which both getbob--x.jsonon any disk. 14 refused and 7 written cases are shared byte for byte with the other package. The collision rule's own choice of names is unchanged.🤖 Generated with Claude Code