inspector: response.setEncoding() causes response.on('data') never triggered when --experimental-network-inspection is enabled
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 122k
- Fork
- 37.4k
- Merge trung bình
- 4 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 272
Mô tả
Version
v24.17.0
Platform
Windows 11 x64 (10.0.26200)
Subsystem
No response
What steps will reproduce the bug?
When experimental network inspection is enabled, calling response.setEncoding() on an http.IncomingMessage causes Node Inspector to throw exception.
The exception interrupts normal stream processing. response.on("data") callback never triggered.
const http = require('http');
http.get("http://example.com", (response) => {
response.setEncoding("utf8");
response.on("data", chunk => {
console.log(chunk);
});
response.on("end", () => {
console.log("end");
process.exit(0);
});
});
Run node --inspect --experimental-network-inspection main.js then open any inspector frontend (Chrome DevTools).
How often does it reproduce? Is there a required condition?
When network inspection feature enabled.
What is the expected behavior? Why is that the expected behavior?
Network inspection should continue to work regardless of whether response.setEncoding() is used.
What do you see instead?
Nodejs throws exception and interrupts normal stream processing. response.on("data") callback never triggered.
Additional information
VSCode extension debugging host enables this feature and breaks my extension development. Waste 2 days to find out why every http request got empty response.
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.
Hướng nghiên cứu
Bắt đầu bằng cách chạy ví dụ HTTP được cung cấp với node --inspect --experimental-network-inspection main.js và một frontend inspector, sau đó ghi lại exception được kích hoạt bởi response.setEncoding(). Truy vết phần xử lý network inspection làm gián đoạn stream; hoàn tất khi các callback data và end chạy bình thường với encoding được bật.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, node.js
- Lĩnh vực
- backend, devtools
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 52/100