Skip to content

fix(widgets): Nd:http の通信断 (status 0) を「通信できません」として描く (notedeck#1294) - #97

Merged
hitalin merged 1 commit into
mainfrom
fix/http-transport-status-zero
Oct 29, 2026
Merged

hitalin merged 1 commit into
mainfrom
fix/http-transport-status-zero

Conversation

@hitalin

@hitalin hitalin commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

なぜ

NoteDeck は Nd:http の通信断 (DNS 失敗・接続拒否・タイムアウト・応答の読み取り失敗) を throw ではなく { status: 0, headers: {}, body: "", error } の値で返すようになった (notedeck#1294)。AiScript には try/catch が無いので、従来はウィジェット側で捕捉できず「読み込み中…」のまま固まっていた。

何を

  • Nd:http を使う 22 ウィジェット + url-safety-check プラグインで、status == 0 を「HTTP 0」ではなく「通信できません」(nodeinfo / osv / soundcloud は「〜に接続できません」) として描く。既存の status != 200 分岐に乗せただけで、取得ロジックは変えていない
  • status を見ずに Json:parse していた listenbrainz / weather は非 200 を先に分岐し、理由つきのエラー行を出す
  • 理由を出していなかった earthquake / joinmisskey-stats は lastStatus を持って理由 (通信できません / HTTP n) を添える
  • docs/registry-format.md の「NoteDeck と本家の差分」に値の形を追記
  • registry:build で api.json / 一覧 JSON を再生成

検証

  • 編集した 23 本すべて AiScript 1.2.1 の Parser で parse OK
  • pnpm registry:build / pnpm contract:verify (157 件合格) / check-registry-integrity OK
  • 実機未確認 (NoteDeck 側の status 0 は develop のみ。古い NoteDeck では従来どおり throw するので、この変更で挙動が悪化する経路は無い)

🤖 Generated with Claude Code

NoteDeck は Nd:http の通信断 (DNS 失敗・接続拒否・タイムアウト) を throw では
なく `{ status: 0, error }` の値で返すようになった (notedeck#1294)。従来は
AiScript に try/catch が無いため捕捉できず、ウィジェットが「読み込み中…」の
まま固まっていた。

Nd:http を使う 22 ウィジェットと url-safety-check プラグインで、status 0 を
「HTTP 0」ではなく「通信できません」(接続できません) として描く。status を
見ずに Json:parse していた listenbrainz / weather と、理由を出していなかった
earthquake / joinmisskey-stats は、非 200 を先に分岐して理由を出すようにした。
docs/registry-format.md の NoteDeck 差分に値の形を追記。

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant