[diagnostics rc.14 / next] Browser bridge drops shared references, so `expectNoSilentHolds` throws on any capture with a `LONG_HOLD`
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
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của solidjs/solid
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 50/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 28/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của solidjs/solid
Issue tương tự
-
priority:high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
immich-app/immich#32426 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue hacktoberfest help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
libredb/libredb-studio#1756 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
state:triage-needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày