SPC convective notifications collapse Day 1/2/3 into one — lower-day risk silently dropped #42

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

_process_convective_for_sub (app/services/spc_processor.py:153-158) filters
outlooks to days {1,2,3} and calls choose_highest_risk_for_point once over
the merged list, so only the globally-highest-risk day produces a
SentAlert/notification. A location under Day 1 MRGL + Day 2 ENH never gets
the Day 1 notification while Day 2 remains higher. The dashboard path
(_refresh_dashboard_for_location, spc_processor.py:755-763) already loops
for day in (1, 2, 3) and upserts each day independently — port that shape to
the notification path: group by day, choose per day, record/dispatch per day.

Test gap that let this ship: test_poll_spc_uses_highest_matching_risk_and_dedups_repeat_runs
only exercises two day=1 outlooks. Add a cross-day test (Day 1 lower + Day 2
higher → both notify).

Acceptance criteria:

  • Each of Day 1/2/3 matching a location records and dispatches independently
  • Cross-day regression test added
  • Dashboard and notification records agree for the same poll

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

`_process_convective_for_sub` (app/services/spc_processor.py:153-158) filters `outlooks` to days {1,2,3} and calls `choose_highest_risk_for_point` once over the merged list, so only the globally-highest-risk day produces a `SentAlert`/notification. A location under Day 1 MRGL + Day 2 ENH never gets the Day 1 notification while Day 2 remains higher. The dashboard path (`_refresh_dashboard_for_location`, spc_processor.py:755-763) already loops `for day in (1, 2, 3)` and upserts each day independently — port that shape to the notification path: group by day, choose per day, record/dispatch per day. Test gap that let this ship: `test_poll_spc_uses_highest_matching_risk_and_dedups_repeat_runs` only exercises two day=1 outlooks. Add a cross-day test (Day 1 lower + Day 2 higher → both notify). **Acceptance criteria:** - [ ] Each of Day 1/2/3 matching a location records and dispatches independently - [ ] Cross-day regression test added - [ ] Dashboard and notification records agree for the same poll --- _Filed from the 2026-07-17 codebase audit (`docs/.internal/report-2026-07-17.md`), finding F-03._
Author
Contributor

Fixed in #92 (merged to main). _process_convective_for_sub now loops for day in (1,2,3), choosing the highest risk per day and recording/dispatching each independently (mirroring the dashboard path), so a lower-risk same-day outlook is no longer dropped when a later day is higher. Cross-day regression test added (Day 1 lower + Day 2 higher → both notify).

Fixed in #92 (merged to `main`). `_process_convective_for_sub` now loops `for day in (1,2,3)`, choosing the highest risk per day and recording/dispatching each independently (mirroring the dashboard path), so a lower-risk same-day outlook is no longer dropped when a later day is higher. Cross-day regression test added (Day 1 lower + Day 2 higher → both notify).
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#42
No description provided.