Conversation
…ate notifications fire The notification event path was calling _get_nws_forecast_and_discussion, which wrapped forecast + discussion in a single try/except. A transient forecast HTTP error (e.g. 503) caused the whole function to return (None, None, None), silently dropping discussion_issuance_time and preventing AFD update notifications from ever firing. Changes: - weather_client_nws.py: extract forecast fetch into its own try/except inside get_nws_forecast_and_discussion so discussion still returns on forecast failure. Add new get_nws_discussion_only() that fetches grid data + AFD without touching the forecast endpoint at all. - weather_client_base.py: get_notification_event_data now calls _get_nws_discussion_only instead of _get_nws_forecast_and_discussion, removing an unnecessary forecast fetch from the 60-second poll path and eliminating the forecast-failure silent suppression entirely. Added debug logging for issuance_time and discussion status at each check. - notification_event_manager.py: add debug log lines in _check_discussion_update for every early-return path (no issuance_time, first-run, unchanged, and updated) so failures are visible at DEBUG level. - tests: add tests/test_nws_afd_notification.py with 9 tests covering forecast failure isolation, discussion-only happy path, no-forecast-call assertion, and get_notification_event_data integration. Update test_split_notification_timers.py to mock _get_nws_discussion_only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…scussion and get_nws_discussion_only Covers the previously uncovered `client=None` code paths in both NWS functions (lines 636-643, 650, 657, 709-714, 717, 722, 727) and the `_get_nws_discussion_only` delegation method in weather_client_base (line 1066). diff-cover now reports 100% on all changed lines. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace Linux-only `%-I` format specifier with `%I` + lstrip("0")
to avoid "Invalid format string" errors on Windows.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Orinks
added a commit
that referenced
this pull request
Mar 14, 2026
…on (#453) Improves `summarize_discussion_change` to extract meaningful content from AFD updates: 1. **Primary**: Extracts `.WHAT HAS CHANGED...` section (NWS includes this in many AFDs) 2. **Fallback**: Extracts `.KEY MESSAGES...` section 3. **Final fallback**: First new line (existing behavior) Summary truncated to 300 chars for toast readability. Follow-up to #452. --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
AFD (Area Forecast Discussion) update notifications never fired, even though the discussion clearly updated in the UI. Alert notifications worked fine.
Root Cause
get_notification_event_datawas calling_get_nws_forecast_and_discussion, which wraps the forecast and discussion fetches in a single try/except. Any transient HTTP error on the forecast endpoint (e.g. 503) caused the entire function to return(None, None, None), silently droppingdiscussion_issuance_time. Without an issuance time,_check_discussion_updatereturnedNoneon every poll, so notifications never fired.Fix
weather_client_nws.py: Extracted the forecast fetch into its own try/except insideget_nws_forecast_and_discussion— a forecast failure now logs a warning and returnsforecast=Nonebut still returns the discussion. Added a newget_nws_discussion_only()that fetches grid data + AFD without touching the forecast endpoint at all (lighter weight, no blast radius from forecast failures).weather_client_base.py:get_notification_event_datanow calls_get_nws_discussion_onlyinstead of_get_nws_forecast_and_discussion, eliminating the unnecessary forecast fetch from the 60-second poll path and removing the silent-suppression bug entirely. Added debug logging fordiscussion_issuance_timeand alert count at each check.notification_event_manager.py: Added debug log lines in_check_discussion_updatefor every early-return path (no issuance_time, first-run, unchanged, updated) so diagnosing notification failures is straightforward.Tests
tests/test_nws_afd_notification.py(9 tests):get_nws_discussion_onlyhappy pathget_nws_discussion_onlynever calls forecast endpointget_nws_discussion_onlyreturns(None, None)on non-retryable errorget_notification_event_datapopulatesdiscussion_issuance_timeget_notification_event_datacalls_get_nws_discussion_only, not forecast+discussionget_notification_event_datadoesn't crash on(None, None)from discussion fetchtest_split_notification_timers.pyto mock_get_nws_discussion_onlyinstead of_get_nws_forecast_and_discussionin theTestGetNotificationEventDataclass.🤖 Generated with Claude Code