[diagnostics rc.14 / next] Browser bridge drops shared references, so `expectNoSilentHolds` throws on any capture with a `LONG_HOLD`
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, playwright, typescript
- 领域
- devtools
调研方向
从 packages/diagnostics/src/browser.ts 中的 toSerializable 开始,end() 会在序列化 attribution holds 之前使用它。检查 checkLongHold,了解为什么 hold 的 acknowledgements 和 blockers 数组会出现在诊断数据中,然后查看 isSilent,expectNoSilentHolds 在那里读取 .length。当 LONG_HOLD 捕获在 attribution.holds 上保留这些数组,并且 expectNoSilentHolds 不再抛出异常时,即完成。
由索引模型根据 Issue 内容生成。
描述
Summary
installDiagnosticsBridge's end() passes the artifact through toSerializable (packages/diagnostics/src/browser.ts). Its seen set treats every repeated object as a cycle, not only an object that contains itself. checkLongHold puts the hold's own acknowledgements and blockers arrays into the LONG_HOLD diagnostic's data, and diagnostics are serialized before attribution.holds. So the transferred hold record has no acknowledgements and no blockers. Then expectNoSilentHolds(artifact) throws TypeError: Cannot read properties of undefined (reading 'length') in isSilent.
Any Playwright capture that records a LONG_HOLD (for example, one that allows it with expectNoDiagnostics(artifact, { allow: ["LONG_HOLD"] })) cannot also check expectNoSilentHolds, and the hold evidence loses its blockers.
Reproduces on 2.0.0-rc.14 and on next at 358159c6.
Reproduction
Capture through the bridge (captureBrowserArtifact or __SOLID_DIAGNOSTICS__.end()) a navigation whose destination read takes longer than longHolds.infoMs (500 ms), then:
const hold = artifact.attribution.holds.find(h => h.long);
hold.acknowledgements; // undefined (present in-page)
hold.blockers; // undefined (present in-page)
expectNoSilentHolds(artifact); // TypeError in isSilent
Fix
Track only the ancestors of the value being written, so that a shared, non-cyclic reference is kept:
function toSerializable<T>(value: T): T {
const ancestors: object[] = [];
return JSON.parse(
JSON.stringify(value, function (this: unknown, _key, entry) {
if (typeof entry === "function" || typeof entry === "symbol") return undefined;
if (typeof entry === "bigint") return String(entry);
if (typeof entry !== "object" || entry === null) return entry;
while (ancestors.length > 0 && ancestors.at(-1) !== this) ancestors.pop();
if (ancestors.includes(entry)) return undefined; // a real cycle
ancestors.push(entry);
return entry;
})
);
}
(checkLongHold could also copy the arrays into data, but the serializer is the general cause.)
(submitted by Claude Opus 5.5 on behalf of rvlzzr)
- 主要语言
- TypeScript
- 星标
- 36.1k
- 派生
- 1.1k
- 平均合并
- 10 小时 44 分钟
- 30 天内合并 PR
- 339
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
solidjs/solid 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 50/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 28/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 58/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
A hung CI job runs for 6 hours before it is cancelled可能已有人在做 @Olanetsoft 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
Olanetsoft/agent-lookout#110 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
thedotmack/claude-mem#4757 ·
维护者通常 1 天内回复
-
🐛 bug 🗺️ MCP OAuth
难度 2/5 1-3 小时 新手友好度 62/100
LibreChat-AI/LibreChat#17077 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 75/100