Follow NWS /alerts/active pagination — alerts beyond page 1 are dropped then falsely cleared #41

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

fetch_alerts_for_states (app/services/nws.py:164-180) reads features from a
single response and never follows pagination.next. In a large multi-state
outbreak, alerts past page 1 are invisible: no notifications, and existing
SentAlert rows for them are cleared as "disappeared from feed" by
_clear_missing_alerts. Loop on pagination.next (bounded, e.g. max 10 pages),
accumulate features, and log when pagination occurs so outbreak-scale polls are
observable.

Acceptance criteria:

  • Multi-page active-alert responses are fully consumed
  • Test with a mocked paginated response asserting all pages' alerts process
  • Page-follow is bounded and logged

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

`fetch_alerts_for_states` (app/services/nws.py:164-180) reads `features` from a single response and never follows `pagination.next`. In a large multi-state outbreak, alerts past page 1 are invisible: no notifications, and existing `SentAlert` rows for them are cleared as "disappeared from feed" by `_clear_missing_alerts`. Loop on `pagination.next` (bounded, e.g. max 10 pages), accumulate features, and log when pagination occurs so outbreak-scale polls are observable. **Acceptance criteria:** - [ ] Multi-page active-alert responses are fully consumed - [ ] Test with a mocked paginated response asserting all pages' alerts process - [ ] Page-follow is bounded and logged --- _Filed from the 2026-07-17 codebase audit (`docs/.internal/report-2026-07-17.md`), finding F-02._
Author
Contributor

Fixed in #92 (merged to main). fetch_alerts_for_states now follows pagination.next (bounded to 10 pages, logged when >1 page) so large multi-state outbreaks aren't truncated to page one and then cleared as "disappeared". Regression test uses a mocked 2-page response asserting both pages' alerts process.

Fixed in #92 (merged to `main`). `fetch_alerts_for_states` now follows `pagination.next` (bounded to 10 pages, logged when >1 page) so large multi-state outbreaks aren't truncated to page one and then cleared as "disappeared". Regression test uses a mocked 2-page response asserting both pages' alerts process.
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#41
No description provided.