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'
|
||||
if (!nodeRegistry.has(kind)) {
|
||||
nodeRegistry._register({
|
||||
@@ -426,11 +426,21 @@ describe('scene commit boundary', () => {
|
||||
collections: {},
|
||||
dirtyNodes: new Set<AnyNodeId>(),
|
||||
materials: {},
|
||||
nodes: { [id]: node },
|
||||
rootNodeIds: [id],
|
||||
nodes: {},
|
||||
rootNodeIds: [],
|
||||
})
|
||||
clearSceneHistory()
|
||||
|
||||
expect(
|
||||
applySceneOperationPatch({
|
||||
materialChanges: [],
|
||||
nodeCreates: [{ node, position: 0 }],
|
||||
nodeDeletes: [],
|
||||
nodeUpdates: [],
|
||||
}),
|
||||
).toBe(true)
|
||||
expect(useScene.getState().nodes[id]).toEqual(node)
|
||||
|
||||
expect(
|
||||
applySceneOperationPatch({
|
||||
materialChanges: [],
|
||||
|
||||
@@ -1525,7 +1525,7 @@ function sceneOperationPatchNextState(
|
||||
return null
|
||||
}
|
||||
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) {
|
||||
const id = change.node.id
|
||||
|
||||
Reference in New Issue
Block a user