Alert clearing treats NWS fetch failure as "no active alerts" — mass false all-clears #40
Labels
No labels
area:ai
area:ci-cd
area:notifications
area:observability
area:public-pages
backlog
bug
duplicate
enhancement
help wanted
invalid
question
type:decision
type:feature
type:infra
type:maintenance
type:security
v1.0.1
v1.1.0
v1.2.0
v1.3.0
v2.0.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot#40
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fetch_alerts_for_statesreturns[]on anyhttpx.HTTPError(app/services/nws.py:163-174).
poll_alerts_jobpasses that straight toprocess_alerts(app/services/scheduler.py:48-50), whose_clear_missing_alerts(app/services/alert_processor.py:307-342) then clearsevery uncleared
SentAlert— dispatching all-clear notifications to allchannels — because nothing is in
active_matches. The next good poll re-sendseverything as new. One transient NWS error = false all-clears for every active
alert, including live warnings, followed by duplicate re-alerts.
Fix (recommended):
Nonefromfetch_alerts_for_stateson HTTP error; skipprocess_alertsfor that cycle.no retry exists on any NWS call today (all of nws.py is single-attempt).
_clear_missing_alerts'sdisappearedbranch when the loadedlocationslist is empty (same mass-clear reachable via that path,alert_processor.py:189-199).
endsnorexpiresgetexpires=NULLand are invisible to the dashboard (expires > nowfilter,app/main.py:176) and to all clearing paths (
expires != Nonefilters).Store a synthetic expiry (e.g. onset/sent + a default window) instead.
Acceptance criteria:
disappearedclear pathends/expiresreceive a synthetic expiry and clear normallyFiled from the 2026-07-17 codebase audit (
docs/.internal/report-2026-07-17.md), finding F-01.Fixed in #92 (merged to
main, deployed to dev via CD). NWS fetches now retry with jittered backoff and returnNoneon failure;poll_alerts_jobskips the cycle entirely onNone(no clearing, no dispatch), so a transient outage no longer fires false all-clears. Mass-clear is also gated on a non-empty locations list, and alerts lacking bothendsandexpiresreceive a synthetic 6h expiry. Regression tests cover fetch-failure→no-clear and the synthetic expiry.