validate unique IDs across data schemas - #1297
Open
VasilisDragon wants to merge 3 commits into
Open
VasilisDragon wants to merge 3 commits into
VasilisDragon wants to merge 3 commits into
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
extremeheat
reviewed
Sep 16, 2026
Comment on lines
+95
to
+103
| if (dataName === 'blocks' && instance && instance.length >= 2) { | ||
| it('blocks.json rejects duplicate IDs', function () { | ||
| const blocks = JSON.parse(JSON.stringify(instance.slice(0, 2))) | ||
| blocks[1].id = blocks[0].id | ||
| const schema = require('../../../schemas/blocks_schema.json') | ||
| assert.strictEqual(v.validate(schema, blocks), false) | ||
| assert.ok(v.errors.some(error => error.keyword === 'uniqueItemProperties'), JSON.stringify(v.errors, null, 2)) | ||
| }) | ||
| } |
Member
There was a problem hiding this comment.
Shouldn't be scoped to just blocks
Author
There was a problem hiding this comment.
Expanded this to ten schemas and made the test follow uniqueItemProperties. Item ID checks still need the old Bedrock collisions resolved; entity IDs have separate mob/object namespaces. Kept the block-state range checks.
This branch has not been 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.
Added ID uniqueness to ten schemas and changed the regression test to follow each schema's
uniqueItemProperties. The Bedrock state-range tests are unchanged.Also removed the duplicate 1.8 biome entry and included @AnonymoDGH's effects fixes from #1236. Related to #695, but keeps the current file layout.
Left entities out because of their old mob/object ID namespaces. Items still need the historical Bedrock collisions and the block-item audit's cached-data mutation fixed.
284 schema regression tests and 902 loader tests pass locally. The full tooling suite hits the same 40-second assertion before and after. Main CI and Bedrock CI passed.
Checked the data corrections against the official clients:
Redwood Taiga Hills Minarm.<clinit>, offsets 1714–1735. The readable 1.8.9 source agrees; the 1.8 check uses the linked client.DolphinsGrace=30,BadOmen=31,HeroOfTheVillage=32. Readable 1.14.4 registrations.