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

オープン 初心者向け
#222 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
electron, javascript, node.js
領域
desktop

調査の方向性

electron/main.js から始めます。initLogging(137行目付近)は fs.createWriteStream でログ用ストリームを作成しますが、その error イベントを一度も監視していません。また log() は logFile.write を try/catch で囲んでいますが、これでは非同期エラーを捕捉できません。ダイアログが表示される経路を確認するため、uncaughtException ハンドラ(964行目付近)を読んでください。ストリームのエラーでファイルへのログ記録が無効になり、コンソールへの報告が一度だけ行われ、未処理例外のダイアログが表示されないことで完了です。書き込みエラーを強制的に発生させ、コンソールへのログ出力が継続することを確認して検証してください。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
JavaScript
スター
162
フォーク
6
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tsiger/widgetizer のほかの issue

tsiger/widgetizer の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。