Commit cba1f84
fix(yjsSync): promoteOntologyToTask 拆成两个 set 避免 immer 单 set 多数组引用 stable
bug: 单个 set callback 内同时 state.nodes.push + state.edges.push 时,
yjsSync 的 store.subscribe 拿到的 state.nodes === lastNodes (引用相等),
被 short-circuit return, 新创建的 TaskNode 永远不 push 到 yjs.
Conductor 看不到 pending+auto 的 task, ResultNode 永远不涌现.
实测: yjs LevelDB 只有老 task, 新 task 在 zustand 里 (DOM 渲染了) 但 yjs 0 同步.
其他 add 方法 (addConceptNode 等) 都是单数组 set, 没踩到这个雷.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 7df13de commit cba1f84
1 file changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1896 | 1896 | | |
1897 | 1897 | | |
1898 | 1898 | | |
1899 | | - | |
1900 | | - | |
1901 | | - | |
1902 | | - | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
1903 | 1903 | | |
1904 | 1904 | | |
1905 | | - | |
| 1905 | + | |
1906 | 1906 | | |
1907 | 1907 | | |
1908 | 1908 | | |
| |||
0 commit comments