Repository navigation
store: match vault names case-insensitively - #78
Closed
team-humaki wants to merge 1 commit into
Closed
team-humaki wants to merge 1 commit into
team-humaki wants to merge 1 commit into
Conversation
Lookups, deletes, and same-user creates treat notes and NOTES as the same vault. Stored spelling is unchanged. Fixes mtiluk#75.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What
Vault lookups, deletes, and same-user uniqueness checks now use SQLite
COLLATE NOCASE.notesandNOTESresolve to the same vault. The stored spelling is unchanged, so existing rows keep their original casing.Why
Fixes #75.
VaultByNamestill compared names byte-for-byte, which is what the HTTP TODO called out. Blob and manifest routes already go throughVaultByName, so they pick up the same matching. Creates reject a case-only duplicate instead of inserting a second row that the unique index would allow.Testing
notes/NOTESagainst storedNotes; delete viaNOTES;CreateVault("NOTES")afternotesreturnsErrVaultExists.GET /vaults/NOTESreturns the vault stored asnotes.go test ./...andgo test -race ./internal/server/store/ ./internal/server/http/green.