Repository navigation
fix: a declaration's kind holds no white space and no control character, like its owner - #55
Merged
Merged
Conversation
…er, like its owner Closes #51. A named declaration's key is over its kind and its name with a line break between them, and a kind was only refused when it was empty. Kind "index\nx" named "y" and kind "index" named "x\ny" therefore had one key, and the store refused the second as declared twice. Co-Authored-By: Claude Fable 5.2 <[email protected]>
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.
Closes #51
Problem
A named declaration's key is hashed over
name\n{Kind}\n{name}.DeclarationCodec.Validaterefused an owner with a colon, white space or a control character, and a kind only when it was empty. So kind"index\nx"named"y"and kind"index"named"x\ny"had one key.A consumer would have seen the second of two different declarations refused as "declared twice". Nothing was lost or replaced.
Change
Declarations/Internal/DeclarationCodec.cs:Validaterefuses a kind with white space or a control character.KeyandValueboth go through it, soDeclare,Redeclareand the reader do.Infrastructure/Internal/SchemaKitStrings.cs:InvalidKind, which says why.A name may still hold a line break: it is the last part of the identity, so nothing can follow it.
Tests
Kernel tests without a server: 263 before, 271 after. The PostgreSQL integration tests did not run locally; CI runs them.
A_declaration_that_cannot_be_stored_is_refused: a line break (named and unnamed), a space, a tab, a no-break space, U+0001 and U+0085.A_kind_cannot_borrow_part_of_another_declarations_nameholds the pair from the issue.A_kind_cannot_borrow_part_of_another_declarations_nameThis and the PR for #50 both add a message to
SchemaKitStrings.csand tests toDeclarationCodecTests.cs, in different places.🤖 Generated with Claude Code