Skip to content

fix(notifications): filter SPS products by location zone#637

Merged
Orinks merged 1 commit intodevfrom
codex/sps-county-zone-filter
Apr 29, 2026
Merged

fix(notifications): filter SPS products by location zone#637
Orinks merged 1 commit intodevfrom
codex/sps-county-zone-filter

Conversation

@Orinks
Copy link
Copy Markdown
Owner

@Orinks Orinks commented Apr 29, 2026

Summary

  • Filter office-wide Special Weather Statement products by the saved location's NWS zone IDs before notification evaluation.
  • Parse UGC zone lines, including ranged forms such as TXZ105>107, and compare them with the location's forecast, fire, and county zone IDs.
  • Add regression coverage for Copperas Cove (TXZ157) not receiving Dallas/Tarrant (TXZ118-119) SPS products while still keeping a local TXZ157 SPS.

Root cause

The active alert path honors the user's alert area setting, but the SPS product path reads the CWA-wide /products/types/SPS/locations/{office} cache. For offices like FWD, that feed includes Dallas-area statements even when a Copperas Cove point has no active alert. Without a zone filter, those office products could be treated as informational SPS notifications for the current location.

Validation

  • uv run pytest -q -n 0 --tb=short tests/test_split_notification_timers.py::TestSpsProductLocationFiltering tests/test_notification_sps_dedupe.py
  • latest Ruff: ruff format --check .
  • uv run ruff check src tests
  • uv run pyright

@Orinks Orinks merged commit 0f7409f into dev Apr 29, 2026
3 checks passed
@Orinks Orinks deleted the codex/sps-county-zone-filter branch April 29, 2026 18:44
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.

1 participant