Skip to content

fix(alerts): a blank webhook URL, ping or label is not set - #59

Open
MorningLightMountain713 wants to merge 1 commit into
masterfrom
fix/blank-alert-settings
Open

MorningLightMountain713 wants to merge 1 commit into
masterfrom
fix/blank-alert-settings

Conversation

@MorningLightMountain713

Copy link
Copy Markdown

A node whose config.js has web_hook_url: '' tried to send every Discord alert to an empty URL. Each attempt failed with Only absolute URLs are supported, after up to ~40 s of public-IP lookups. A label: '' put an empty Name: field on every Discord embed, which Discord refuses, so every alert from that node failed.

  • isSet (alerts.js): an optional alert setting that is missing, '' or '0' is not set.
  • web_hook_url: no Discord alert is attempted unless it is set, and the startup log says Discord alert: disabled.
  • label: the Discord Name: field and the Telegram Name: line appear only when it is set.
  • ping: mentioned only when set; the startup log agrees.
  • telegram_alert: the startup log reports Telegram alerts as enabled only when it is 1, the value that sends them.

Tests

  • test/alerts.test.js: undefined, '' and '0' are not set; a URL, a user id and a name are. Dropping the '' or the '0' case fails it.
  • npm test, ESLint and Prettier pass in CI.

🤖 Generated with Claude Code

A webhook URL, ping or label that is missing, '' or '0' is not set: no
Discord alert is attempted without a webhook URL, and no Name field is
sent without a label, since Discord refuses an embed field with an empty
value. The startup log reports Telegram alerts as enabled only when
telegram_alert is 1, the value that sends them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Cabecinha84 Cabecinha84 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK. Tests pass (70/70), merges cleanly with master. Non-blocking: a blank telegram_bot_token or telegram_chat_id with telegram_alert 1 still fails at send time (only logged); could be a follow-up.

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.

2 participants