Commit 291ad64
fix(canvas): 渲染前清理孤儿 parentNode 防 React Flow 崩溃
React Flow 11 在 child.parentNode 找不到时直接 throw "Parent node X
not found" 整个画布崩 (用户图 37 报告 ErrorBoundary, 被迫切房间号绕开)。
yjs 同步顺序 / undo 撤销 / 老房间残留都可能造成短暂 parent-child 不一致。
KnowledgeCanvas 渲染前 sanitize: dangling parentNode 直接清掉, 孤儿
退化成普通根节点继续渲染, 不影响数据修复 (yjs 后续 sync 到 parent 后
渲染恢复正常)。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9de86c6 commit 291ad64
1 file changed
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
284 | 304 | | |
285 | 305 | | |
286 | 306 | | |
| |||
0 commit comments