A crash in the task that continues `HttpClient.send` is lost
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- Une demi-journée
- Accessibilité débutants
- 68/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- javascript, node.js
- Domaine
- backend
Piste de recherche
Start with the HttpClient.send implementation and its fetch promise chain, focusing on the .then and .catch callbacks that invoke the scheduler. Reproduce the issue with src/Main.gren and run.sh, then add coverage using a task that throws after the response. Done means that task crash is reported normally and is not converted into a failed request or silently discarded.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Repository: gren-lang/node
Found against: gren 0.6.6, gren-lang/core 7.6.0, gren-lang/node 6.2.0
(and main at 982f87c), node 2
Summary
_HttpClient_request answers the scheduler from inside fetch's promise
chain, and the chain ends in a .catch that turns an error into a failed
request:
fetch(...)
.then((res) => { ... return callback(__Scheduler_succeed(...)); })
.catch((e) => { ... return callback(__Scheduler_fail(...)); });
callback steps the process there and then, so the task that continues the
response runs inside the .then. A crash there, a Debug.todo or a throw from
kernel code, is caught by the .catch as though the request had failed. The
second callback finds the binding already answered, and the crash is gone:
the program ends with nothing on stderr.
task after send |
prints | should print |
|---|---|---|
Task.andThen (\_ -> Debug.todo "after the response") |
nothing | Error: TODO in module \Main` on line 19` |
the same, after Task.succeed {} in place of the request |
Error: TODO in module \Main` on line 19` |
the same |
Reproduction
~/prj/gren-bug-reports/2026-10-12-httpclient-crash-after-response: ./run.sh
builds and runs src/Main.gren under devbox, which provides gren 0.6.6 and
node 22:
main : Node.SimpleProgram a
main =
Node.defineSimpleProgram <| \env ->
Init.await HttpClient.initialize <| \http ->
Node.endSimpleProgram
(HttpClient.get "data:text/plain,hello"
|> HttpClient.expectString
|> HttpClient.send http
|> Task.andThen (\_ -> Debug.todo "after the response")
|> Task.onError (\_ -> Stream.writeLineAsBytes "the request failed" env.stdout |> Task.map (\_ -> {}) |> Task.onError (\_ -> Task.succeed {}))
)
It prints nothing. Replacing the three HttpClient lines with Task.succeed {}
prints the TODO.
- Langage dominant
- JavaScript
- Étoiles
- 13
- Forks
- 6
- Merge moyen
- 2 j 4 h
- PR mergées (30 j)
- 2
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de gren-lang/node
-
breaking enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 38/100
-
breaking enhancement
Difficulté 3/5 1-2 jours Accessibilité débutants 42/100
-
breaking bug
Difficulté 3/5 1-2 jours Accessibilité débutants 64/100
-
enhancement
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
-
Sqlite: Bytes encoder/decoderOuverteenhancement
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
Toutes les issues de gren-lang/node
Issues similaires
-
[External Plugin]: CarboneOuverteexternal-plugin ready-for-review third party
Difficulté 2/5 1-3 heures Accessibilité débutants 63/100
github/awesome-copilot#5259 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug]: fileUploadMatrix.test.ts URL case does a real DNS lookup and fails offlinePeut-être pris @r2jaff l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
ComposioHQ/composio#5054 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
addyosmani/agent-skills#717 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
apache/rocketmq-dashboard#7318 ·
Les mainteneurs répondent en général sous 3 jours
-
W3cOuverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
web-platform-tests/wpt#64017 ·
Les mainteneurs répondent en général sous 1 jour