http.Server should lower off, listeners, and newListener for HTTP events
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 20/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- nodejs, typescript
- Área
- networking
Línea de trabajo
Start with the repro program in the issue body and the T3 harness it cites, src/httpResponseErrorGuard.ts (rejectRequestsUntilServing), to see which http.Server calls fail to lower: off, listeners, and on("newListener") for HTTP events. Work already exists in linked pull request #2940, so check that first. Done means the repro compiles and matches Node's listener ordering and identity semantics.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
http.Server is a net handle, not %EventEmitter. off(), listeners(), and on("newListener") therefore have no lowering for HTTP events, even though on("request") / on("upgrade") already do.
T3 Code's src/httpResponseErrorGuard.ts (rejectRequestsUntilServing) is the real-world harness: it registers temporary 503 handlers, then uses newListener + listeners().includes() + off() to drop them when the serving handlers attach. Node emits newListener before the add, so the handoff is synchronous.
Expected
This program should compile and match Node:
import * as http from "node:http";
const server = http.createServer();
const rejectRequest = (_req: http.IncomingMessage, res: http.ServerResponse) => {
res.writeHead(503).end();
};
server.on("request", rejectRequest);
server.on("newListener", function onNewListener(event) {
if (event === "request") server.off("request", rejectRequest);
if (!server.listeners("request").includes(rejectRequest)) {
server.off("newListener", onNewListener);
}
});
server.on("request", (_req, res) => {
res.end("ok");
});
newListener fires before the second on("request"), off removes the last matching HTTP listener, and listeners() returns those functions by identity.
Actual (0.4.7)
server.off("request" | "upgrade" | "newListener"), server.listeners(...), and server.on("newListener") are SC1090 / no-lowering. Net-only off("error" | "close" | ...) already works.
Out of scope (fork-side)
res.on("error") on ServerResponse is a different surface. The T3 fork should replace that with abort/writableEnded rather than asking scriptc to lower writable error events in this issue.
Evidence
Plan E3: real src/httpResponseErrorGuard.ts harness failed on newListener, listeners(), off(), res.on("error").
- Lenguaje dominante
- TypeScript
- Estrellas
- 6.4k
- Forks
- 204
- Merge medio
- 7 h 35 min
- PR fusionados (30 d)
- 873
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de vercel-labs/scriptc
-
`process.execPath` uses the ANSI API on Windows, so non-ASCII paths are garbled when the ANSI code page is not UTF-8Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 Medio día Aptitud para principiantes 72/100
vercel-labs/scriptc#2910 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Assigning a wide Node object (process.stdout) to a narrow { write } record fails SC2002 (width-copy rules)Posiblemente ocupada @ctate la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
vercel-labs/scriptc#2949 ·
Los mantenedores suelen responder en 1 día
-
Analysis OOM (exit 137 at ~4 GB) on large TypeScript graphsPosiblemente ocupada @espetro la tomó hace 2 días. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
vercel-labs/scriptc#2916 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Publish prebuilt @scriptc/libnode-* packs with the native installerPosiblemente ocupada @ctate la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
vercel-labs/scriptc#2915 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 22/100
vercel-labs/scriptc#2845 ·
Los mantenedores suelen responder en 1 día
Todos los issues de vercel-labs/scriptc
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
hugomrdias/playwright-test#753 ·
Los mantenedores suelen responder en 1 día
-
Review view: Daily/Weekly Review header buttons use the app-wide toolbar control stylePosiblemente ocupada @colherdesopa la tomó hoy. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 90/100
dongdongbh/Mindwtr#1515 ·
Los mantenedores suelen responder en 1 día
-
pending-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
kirodotdev/Kiro#12301 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100