Skip to content

validate unique IDs across data schemas - #1297

Open
VasilisDragon wants to merge 3 commits into
PrismarineJS:masterfrom
VasilisDragon:validate-unique-block-ids
Open

VasilisDragon wants to merge 3 commits into
PrismarineJS:masterfrom
VasilisDragon:validate-unique-block-ids

Conversation

@VasilisDragon

@VasilisDragon VasilisDragon commented Sep 13, 2026 •

Copy link
Copy Markdown

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:

@socket-security

socket-security Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​ajv-keywords@​3.5.210010010080100

View full report

Comment thread tools/js/test/test.js Outdated
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))
})
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be scoped to just blocks

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@VasilisDragon VasilisDragon changed the title validate unique block IDs in schemas validate unique IDs across data schemas Sep 16, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants