Repository navigation
zone_record: file stores check a record at create - #98
Merged
Merged
Conversation
json and toml stored a create unchecked, so an invalid record went in and later rdata edits to it were refused unless they also repaired it. They now run checkRecord as mysql does, and an unchanged PUT answers false on every store.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the file-backed record validation and no-op update changes.
No open issues 🎉
What changed in this PR
Aligns JSON and TOML zone-record behavior with MySQL, extending the PUT validation work from #95 to record creation.
Changes:
- Validates file-backed records before allocating an ID or storing them.
- Returns
falsefor unchanged PUTs, avoiding unnecessary file writes. - Adds shared regression tests for invalid creates and unchanged updates.
| File | Description |
|---|---|
lib/zone_record/test/mysql.js |
Removes the invalid-create test now covered by shared tests. |
lib/zone_record/test/index.js |
Adds cross-backend tests for rejected creates and unchanged PUTs. |
lib/zone_record/store/file.js |
Adds creation validation and no-op update detection. |
CHANGELOG.md |
Documents the JSON and TOML behavior fixes. |
Review effort: Balanced
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.
json and toml stored a create without
checkRecord, so a record mysql refuses went in, and since #95 its rdata edits are refused:The file stores now run the check, and an unchanged PUT answers false on them as it does on mysql.