You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
摘要
composer 草稿中删除 markdown 图片引用(
)会触发 React commit 期NotFoundError: removeChild(double-removal 竞态),随后整个输入框从页面消失(document.querySelector('textarea')为 null),且不刷新页面无法恢复。 直接原因是 slots 系统的两级缺陷:conversation.composer.bar槽位的唯一 entry =InputBar)在删除图片引用时的 draft 重渲染路径抛 commit 期 DOM 异常;SlotErrorBoundary对任何 entry 渲染错误执行永久 abdicate(abdicatedWeakSet,进程级),single cell 投影为空后,渲染器用原始 ledger 判断entries.length > 0走 dead-cell 分支,调用方 fallback 永远用不上——官方默认 UI 被一处渲染异常一键击穿,且无自愈路径。复现步骤
 asdasdasdasd。Ctrl+A后Backspace(或逐字符删除该引用)。slot entry crashed in 'conversation.composer.bar': NotFoundError: Failed to execute 'removeChild' …。根因(源码定位,rc.6)
dsh-client-web-react/lib/index.js:SlotErrorBoundary:384-398:componentDidCatch打印slot entry crashed in '<key>':并回调onEntryError;guarded():628-630:非 chain 种类(含 single)上报{ abdicate: true };entriesOfSlot(key)[0];无 winner 时entries.length > 0 ? deadCell() : fallback——entries.length读的是原始 ledger(SlotCore.entries),host entry 被 abdicate 后仍计数 → 永远走 dead-cell,调用方 fallback 短路。dsh-client-ui-slots/lib/index.js:reportEntryError:332-340:abdicatedWeakSet(:53,进程级)加塞 +markDirty;entriesOfSlot:179-194:投影时跳过 abdicated("first live (non-abdicated) entry");dsh-client-ui-conversation/lib/client.js:conversation.composer.bar声明kind: "single"、scopesession-maybe(:9531-9534);host 以官方InputBar注册 body(:9625-9703);ConversationRoot调renderSlot("conversation.composer.bar", {...})未传 fallback(:6859-6876)→ cell 空时渲染null,composer 区只剩空div.composerStack。B2/Pt/Z2= React DOM commit 助手)。同一渲染路径的第二个症状:发送后图片引用同一段落的后文不渲染。建议修复
方案 A(推荐 · 最小):
renderOutletContent的 dead-cell/fallback 分支改按投影后的 winners(entriesOfSlot)判断——纯 abdicated 的 cell 渲染opts.fallback(或可重试的 crash face);ConversationRoot为conversation.composer.bar传入 fallback(如同一InputBar骨架)。方案 B · 官方默认 entry 豁免/复活:官方包注册的 entry 崩溃时不 abdicate(仅上报+保留 cell head),或加有界复活(如若干轮后重投影重试)——宿主 UI 的一次瞬时渲染异常永远不应移除官方输入栏。
方案 C · 触发隔离:draft mirror/backdrop/装饰段包一层局部错误边界——装饰渲染异常退化为纯文本,而不是拖垮整个
InputBar。影响
环境
验证材料
dsh-client-web-react/lib/index.js:SlotErrorBoundary :384-398 / guarded :625-657 / single 分支 :660-664;dsh-client-ui-slots/lib/index.js:abdicated :53 / reportEntryError :332-340 / entriesOfSlot :179-194;dsh-client-ui-conversation/lib/client.js:composer.bar 声明 :9531-9534 / InputBar 注册 :9625-9703 / renderSlot 调用 :6859-6876;@linxin666/dsh-tool-describe-image@0.1.16tarball 核查:仅注册web-ui.plugin.item,无 composer 槽位贡献;slot entry crashed in 'conversation.composer.bar': NotFoundError … removeChild。First analysis of discussion #2206. Happy to open a PR with fix option A.
All reactions