fix(schema): log warning when removing non-existent field#23
Open
lotaar wants to merge 1 commit into
Open
Conversation
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
Adds a warning when
IndexSchema.removeField()is called with a field name that does not exist in the schema. The warning includes the requested field name and a list of currently available fields to help diagnose typos or incorrect API usage.🎯 Motivation
Previously,
removeField()silently no-opped when the target field was missing. This made it difficult to catch configuration errors or typos during development, as invalid removal attempts went completely unnoticed.🛠 Changes
src/schema/schema.ts: UpdatedremoveField()to emit aconsole.warn()when the field is not found, matching the existing warning pattern used insrc/query/vector.ts.tests/unit/schema/schema.test.ts: Added 3 unit tests:(none)when schema is empty🧪 Testing
npm run test:unitpassesnpm run type-check&npm run type-check:testspassnpm run lint&npm run format:checkpassvi.spyOn(console, 'warn')consistent with existing test patterns.✅ Acceptance Criteria
🔗 Closes #13