Desktop app: a log file write error shows an uncaught-exception dialog.

Đang mở Phù hợp với người mới
#222 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
74/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ệ
electron, javascript, node.js
Lĩnh vực
desktop

Hướng nghiên cứu

Bắt đầu từ electron/main.js: initLogging (khoảng dòng 137) tạo luồng ghi log bằng fs.createWriteStream và không bao giờ lắng nghe sự kiện error của nó, còn log() bao logFile.write trong một khối try/catch nên không thể thấy các lỗi bất đồng bộ. Đọc trình xử lý uncaughtException (khoảng dòng 964) để xem đường dẫn hộp thoại. Hoàn thành khi lỗi luồng tắt ghi log ra tệp, báo cáo một lần duy nhất lên console và không có hộp thoại ngoại lệ không được bắt nào xuất hiện. Kiểm tra bằng cách buộc một lỗi ghi và xác nhận việc ghi log ra console vẫn tiếp tục.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

In the desktop app, a failure writing the log file (disk full, permissions) shows an "Uncaught exception" error dialog, because the log file's stream has no error handler.


  • How it works today. initLogging opens the log with fs.createWriteStream(...) (electron/main.js:137) and never listens for its error event. log() wraps logFile.write(...) in a try/catch, but a write error arrives later as an error event, not a throw.
  • What happens. With no listener, the error goes to the uncaughtException handler (:964), which shows the "Widgetizer Desktop Error" dialog. Its own log() call then writes to the stream that already failed. Not a crash loop, but a disk-full machine gets an alarming dialog about logging, and file logging stops silently afterwards.
  • Found in a review of streams that are left open or unhandled (alongside #215), confirmed against the code on 2026-11-02. Desktop app only.

Fix: attach an error listener that turns file logging off and reports the failure once to the console; end() the stream on an orderly quit.

Done when: a log stream that errors turns file logging off without the uncaught-exception dialog, and console logging carries on.

Start: electron/main.js.

Ngôn ngữ chính
JavaScript
Star
162
Fork
6
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của tsiger/widgetizer

Tất cả issue của tsiger/widgetizer

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.