Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[diagnostics rc.14 / next] Browser bridge drops shared references, so `expectNoSilentHolds` throws on any capture with a `LONG_HOLD`

已关闭 适合新手
#3,960 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

solidjs/solid 的其他 Issue

查看 solidjs/solid 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。