Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

A crash in the task that continues `HttpClient.send` is lost

Offen
#76 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
Ein halber Tag
Anfängerfreundlichkeit
68/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
javascript, node.js
Bereich
backend

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
JavaScript
Sterne
13
Forks
6
Ø Merge
2 T. 4 Std.
Gemergte PRs (30 T.)
2

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus gren-lang/node

Alle Issues in gren-lang/node

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.