Guard details-link generation in richer notifiers — a link failure currently drops the alert #54

Closed
opened 2026-07-18 05:31:19 +00:00 by claude-bot · 1 comment
Contributor

sms.py:182-186 wraps public_alert_details_url_for_alert in try/except and
degrades to no link; discord_bot.py:88/342, matrix_bot.py:65/353,
pushover.py:86/309, webhook.py:182/573, webex.py:131/275 await it unguarded —
an exception aborts the send before any message is built, and with no retry
semantics the notification is permanently dropped for that channel. Make the
link helpers guaranteed-non-raising (they mostly are — verify the session
creation path) and add the SMS-style guard via a shared helper at each call
site. Add one failure-injection test per channel type (fits the notifier test
gap in F-29).

Acceptance criteria:

  • Link-generation exception yields a sent notification without a link on all channels
  • Failure-injection tests cover the five previously unguarded channels

Filed from the 2026-07-17 codebase audit (docs/.internal/report-2026-07-17.md), finding F-15.

sms.py:182-186 wraps `public_alert_details_url_for_alert` in try/except and degrades to no link; discord_bot.py:88/342, matrix_bot.py:65/353, pushover.py:86/309, webhook.py:182/573, webex.py:131/275 await it unguarded — an exception aborts the send before any message is built, and with no retry semantics the notification is permanently dropped for that channel. Make the link helpers guaranteed-non-raising (they mostly are — verify the session creation path) and add the SMS-style guard via a shared helper at each call site. Add one failure-injection test per channel type (fits the notifier test gap in F-29). **Acceptance criteria:** - [ ] Link-generation exception yields a sent notification without a link on all channels - [ ] Failure-injection tests cover the five previously unguarded channels --- _Filed from the 2026-07-17 codebase audit (`docs/.internal/report-2026-07-17.md`), finding F-15._
Author
Contributor

Fixed in #92 (merged to main). Note: on investigation the details-link helper (public_alert_links.py) is already internally guarded, so this landed as defense-in-depth — every notifier call site (all six channels, including signal for full parity) now wraps the call like SMS does and sends without a link on failure. Added a failure-injection regression test per channel that patches the helper to raise and asserts the message still sends.

Fixed in #92 (merged to `main`). Note: on investigation the details-link helper (`public_alert_links.py`) is already internally guarded, so this landed as defense-in-depth — every notifier call site (all six channels, including `signal` for full parity) now wraps the call like SMS does and sends without a link on failure. Added a failure-injection regression test per channel that patches the helper to raise and asserts the message still sends.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/WeatherBot#54
No description provided.