A crash in the task that continues `HttpClient.send` is lost
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, node.js
- Lĩnh vực
- backend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- JavaScript
- Star
- 13
- Fork
- 6
- Merge trung bình
- 2 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của gren-lang/node
-
breaking enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
-
breaking enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
-
breaking bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
Sqlite: Bytes encoder/decoderĐang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Tất cả issue của gren-lang/node
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 83/100
awesome-dsh-plugin/awesome-dsh-plugin#8715 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG]: Document embedding fails with "Cannot have chunkOverlap >= chunkSize" after switching to an embedder with a smaller max chunk lengthCó thể đã có người làm @RaphaelFakhri đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Mintplex-Labs/anything-llm#6810 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage Technical TODO
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
AOSSIE-Org/BabyNest#268 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày