Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Daemon leaves a /rpc connection unanswered when the JSON body root is null

Fechada
#3,453 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
76/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
node.js, typescript

Direção de pesquisa

Start with src/daemon/server/http-rpc-envelope-validation.ts and the /rpc request body handling described in the issue. Add a test that posts each non-object JSON root, including null, and checks for the 400 JSON-RPC -32600 response with id: null; then confirm unexpected throws still receive a response. Done means no /rpc body leaves its connection waiting unanswered.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

needs-triage

Purpose

A POST /rpc body whose JSON root is null is never answered: the connection stays open until the client's own timeout. Any other non-object root is answered correctly, so only this one literal hangs.

Findings

JSON.parse('null') succeeds and yields null, so the envelope check dereferences null.jsonrpc and throws. On main the throw happens inside req.on('end'); inside handleRpcRequest on #3452, which the body reader calls as void handleRpcRequest(...). Neither caller awaits it, so the rejection is dropped and nothing writes a response.

Measured against a live server with a 400 ms client budget, on main @ 5f84627d8 and on #3452's head — identical on both:

body result
null no answer within budget, connection held open
true, 7, "str", {}, [] 400 -32600 Invalid Request

Reported from the #3424 review thread on src/daemon/server/http-rpc-envelope-validation.ts. Deliberately not fixed in #3424: that issue's contract is that observable behavior is preserved exactly, and this path has no test of its own.

Required behavior

A null root is refused the way every other non-object root already is: 400, JSON-RPC -32600 Invalid Request, id: null. No connection is left waiting on a request the daemon will not answer.

Completion

  • A test posts each non-object JSON root, including null, and asserts the answer for every one.
  • No /rpc body leaves the connection unanswered: an unexpected throw on any path still gets a response.
Linguagem predominante
TypeScript
Estrelas
5k
Forks
334
Merge médio
12h 2min
PRs com merge (30d)
678

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de callstack/agent-device

Todas as issues de callstack/agent-device

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.