fix(core): preserve plugin create fields

This commit is contained in:
Aymeric Rabot
2026-07-23 12:32:48 +02:00
parent 08d1bbf017
commit 4b27966f9a
2 changed files with 14 additions and 4 deletions
@@ -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: [],
+1 -1
View File
@@ -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