Preserve JSONRPC request IDs and correctly parse bounded multi-header frames
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Read request dispatch and framing in crates/pet-jsonrpc/src/server.rs, then reply serialization in crates/pet-jsonrpc/src/lib.rs; start with the injectable reader/writer seam from dependency #529. Add deterministic cases for fragmented and coalesced frames, IDs, malformed input, and size limits, using existing fuzz/property tooling where practical. Done means IDs round-trip, framing remains compatible, and invalid input cannot panic or lose requests.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Tracking plan: #528
Priority: P2. Evidence: reproduced on Windows at 4e523ba.
Problem
The transport/dispatcher assumes a single Content-Length header, treats non-u64 request IDs as notifications, and narrows u64 IDs to u32. A bounded harness sent a valid control info request before each case and observed:
| Input | Actual behavior |
|---|---|
Numeric ID 4294967297 |
Response ID 1 |
String ID audit-1 |
No response within 600 ms; routed as notification |
| Optional Content-Type header before the blank separator | No response within 600 ms; payload framing misparsed |
Sources: request dispatch, framing, reply serialization.
The payload length is also used directly for allocation without a documented upper bound.
Scope
- Parse framed headers through the blank line; support optional Content-Type and partial reads without losing subsequent frames.
- Represent supported request IDs without truncation across dispatch, refresh joiners, replies, and errors. Distinguish absent IDs from invalid IDs and valid string/numeric IDs.
- Validate protocol messages and frame size, returning appropriate explicit errors or a documented connection-close outcome where framing cannot be recovered.
- Update the documented supported JSONRPC/framing contract rather than silently broadening or narrowing behavior.
Acceptance criteria
- String and large integer request IDs round-trip unchanged, including coalesced refresh replies and errors.
- Tests cover extra headers, consecutive frames, fragmented header/payload reads, non-ASCII payload byte lengths, and clean/truncated EOF.
- Malformed JSON, invalid request shapes/IDs, invalid lengths, and oversized frames cannot panic, trigger unbounded allocation, or silently lose a request.
- Existing VS Code-style clients and environment/manager notifications remain compatible.
- Fuzz/property-style parser cases are added using existing tooling where practical; deterministic regression cases are mandatory.
Dependencies
Depends on #529 to reuse its injectable reader/writer seam. The complete landing order is in #528. This is separate from the already-fixed stdout logging contamination in #341.
- Ngôn ngữ chính
- Rust
- Star
- 207
- Fork
- 45
- Merge trung bình
- 3 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 12
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 microsoft/python-environment-tools
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
debt
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
microsoft/python-environment-tools#538 · 1 bình luận ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
debt
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
microsoft/python-environment-tools#533 · 2 bình luận ·
Tất cả issue của microsoft/python-environment-tools
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
bug core
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
JIT-compiled number -> Decimal conversion silently overflows instead of raising DECIMAL_OVERFLOW Đang mởfuzz
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
ClickHouse/ClickHouse#122114 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
linebender/vello_svg#90 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100