Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đã đóng Phù hợp với người mới
#3,960 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, playwright, typescript
Lĩnh vực
devtools

Hướng nghiên cứu

Bắt đầu từ toSerializable trong packages/diagnostics/src/browser.ts, hàm mà end() dùng trước khi serialize các attribution holds. Kiểm tra checkLongHold để hiểu vì sao các mảng acknowledgements và blockers của hold xuất hiện trong dữ liệu chẩn đoán, sau đó xem isSilent, nơi expectNoSilentHolds đọc .length. Hoàn thành khi một lần ghi LONG_HOLD giữ các mảng đó trên attribution.holds và expectNoSilentHolds không còn ném lỗi nữa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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)

Ngôn ngữ chính
TypeScript
Star
36.1k
Fork
1.1k
Merge trung bình
10 giờ 44 phút
Pull request đã merge (30 ngày)
339

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của solidjs/solid

Tất cả issue của solidjs/solid

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.