fix(core): preserve plugin create fields
This commit is contained in:
@@ -391,7 +391,7 @@ describe('scene commit boundary', () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
test('validates registered nodes without stripping forward-compatible fields', () => {
|
test('validates registered creates and updates without stripping forward-compatible fields', () => {
|
||||||
const kind = 'test:operation-forward-compatible'
|
const kind = 'test:operation-forward-compatible'
|
||||||
if (!nodeRegistry.has(kind)) {
|
if (!nodeRegistry.has(kind)) {
|
||||||
nodeRegistry._register({
|
nodeRegistry._register({
|
||||||
@@ -426,11 +426,21 @@ describe('scene commit boundary', () => {
|
|||||||
collections: {},
|
collections: {},
|
||||||
dirtyNodes: new Set<AnyNodeId>(),
|
dirtyNodes: new Set<AnyNodeId>(),
|
||||||
materials: {},
|
materials: {},
|
||||||
nodes: { [id]: node },
|
nodes: {},
|
||||||
rootNodeIds: [id],
|
rootNodeIds: [],
|
||||||
})
|
})
|
||||||
clearSceneHistory()
|
clearSceneHistory()
|
||||||
|
|
||||||
|
expect(
|
||||||
|
applySceneOperationPatch({
|
||||||
|
materialChanges: [],
|
||||||
|
nodeCreates: [{ node, position: 0 }],
|
||||||
|
nodeDeletes: [],
|
||||||
|
nodeUpdates: [],
|
||||||
|
}),
|
||||||
|
).toBe(true)
|
||||||
|
expect(useScene.getState().nodes[id]).toEqual(node)
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
applySceneOperationPatch({
|
applySceneOperationPatch({
|
||||||
materialChanges: [],
|
materialChanges: [],
|
||||||
|
|||||||
@@ -1525,7 +1525,7 @@ function sceneOperationPatchNextState(
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
createIds.add(parsed.id)
|
createIds.add(parsed.id)
|
||||||
parsedCreates.push({ node: parsed, position: change.position })
|
parsedCreates.push({ node: change.node, position: change.position })
|
||||||
}
|
}
|
||||||
for (const change of changes.nodeDeletes) {
|
for (const change of changes.nodeDeletes) {
|
||||||
const id = change.node.id
|
const id = change.node.id
|
||||||
|
|||||||
Reference in New Issue
Block a user