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

Preserve JSONRPC request IDs and correctly parse bounded multi-header frames

未关闭
#532 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
rust
领域
api, backend, testing

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

bug

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.

主要语言
Rust
星标
207
派生
45
平均合并
3 天 6 小时
30 天内合并 PR
12

贡献指南

这个仓库没有索引到贡献指南

从这里开始

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

microsoft/python-environment-tools 的其他 Issue

查看 microsoft/python-environment-tools 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

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