fix(core): the game loop stops silently when a library hook throws
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/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ệ
- typescript
- Lĩnh vực
- game-dev
Hướng nghiên cứu
Start with packages/core/src/application/nanoforge-application.ts lines 95–121, where the async loop runs library hooks and schedules the next tick; inspect the existing stop and teardown paths there. Add coverage under packages/core/test for a throwing hook and for a throwing __clear; done means the loop reports the error, stops cleanly, continues teardown across failing clears, and notifies stop observers.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Which package is this bug report for?
core
Issue description
loop is an async function scheduled with setTimeout. When a __events / __run hook rejects (for example a system throws inside ecs.runSystems), this.schedule(loop, …) is never reached and the rejection is unhandled. The game freezes with no error, no __clear, no viewport dispose and no onStop for observers such as the editor; on Bun the server process exits. The teardown branch also stops at the first __clear that throws.
Where:
Evidence:
for (const library of orderedForRun) await runHook(library, "__events");
...
for (const library of orderedForRun) await runHook(library, "__run");
...
this.schedule(loop, tickLengthMs + tickStart - Date.now());
Suggested fix: Wrap the tick body in try/catch: log the error, requestStop(), then run the normal teardown, isolating each __clear. Add a test with a throwing hook (packages/core/test has none).
Found during a code audit of main at be72076.
Code sample
No response
Versions
- Engine
mainat be72076 - pnpm 12.0.0, Node.js 26, Bun 1.3.14
Issue priority
High (immediate attention needed)
I have tested this issue on a development release
be72076
- Ngôn ngữ chính
- TypeScript
- Star
- 7
- Fork
- 2
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 17
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 NanoForge-dev/Engine
-
dependencies enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NanoForge-dev/Engine#513 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug chore tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
NanoForge-dev/Engine#511 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs(network): TSDoc says ICE_SERVERS defaults to an empty list, the code uses public STUN serversĐang mởdocumentation good first issue modules:network
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
NanoForge-dev/Engine#509 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation modules:ecs packages:asset packages:core
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NanoForge-dev/Engine#508 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue modules:music modules:sound
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NanoForge-dev/Engine#505 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của NanoForge-dev/Engine
Issue tương tự
-
Mend: dependency security vulnerability
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 65/100
fdm-monster/fdm-monster#5563 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
be-BOP-io-SA/be-BOP#2849 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
growilabs/growi#12246 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
🐛 The Rulekeeper - An index run that gives up on the lock ends SucceededCó thể đã có người làm @github-actions đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
SSWConsulting/SSW.Rules#2809 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày