Skip to content

NWAC weather: keep the last issuance past 24 hours while a forecast is in force - #1515

Merged
rchlfryn merged 1 commit into
mainfrom
fix/nwac-weather-live-24h-gap
Nov 17, 2026
Merged

rchlfryn merged 1 commit into
mainfrom
fix/nwac-weather-live-24h-gap

Conversation

@rchlfryn

@rchlfryn rchlfryn commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Description

NWAC weather beside a forecast only accepted an issuance from the 24 hours before the published time it was asked with. The mobile app asks api/nwac/nwac-weather-zone with the reader's clock, so when one day's forecast went out later than the day before's (3:00 pm, then 3:30 pm), the route answered { day: null } in between and the app showed a missing forecast even though a recent one existed.

A forecast still in force now keeps the last issuance until the next one is out. A past forecast is still held to an issuance at most a day before it.

Related Issues

Unblocks the weather tab in NWACus/avy#1273.

Key Changes

  • newestFor in src/services/nac/nwacWeatherForForecast.ts applies the 24-hour lower bound only to a held (past) forecast.
  • How far back a forecast in force can reach is set by the days already read: its publish date, the day before, and today. A fully skipped day still answers none.
  • The same function serves the native zone pages and the widget, so they too can fall back to an issuance older than 24 hours when nothing newer forecasts the window on show.
  • docs/afp-products/architecture.md updated to match.

How to test

  1. pnpm test __tests__/server/nwacWeather — the new cases cover a request 30 minutes and an hour past a day since the last issuance, and the same request read days later still answering none.
  2. Against production data once a November forecast is out: ask /api/nwac/nwac-weather-zone?zone=3030&published=<now> a little more than 24 hours after the last issuance and before the next. It answers with the last issuance, not { "day": null }.

Screenshots / Demo video

None, no visual change.

Migration Explanation

None.

Future enhancements / Questions

  • nwac.us picks this up from a published release, not from the merge.
  • A day with no forecast at all still shows nothing the day after. If that should fall back further, the route needs to read more days.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@github-actions

Copy link
Copy Markdown
Contributor

@rchlfryn
rchlfryn added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 220413b Nov 17, 2026
16 checks passed
@rchlfryn
rchlfryn deleted the fix/nwac-weather-live-24h-gap branch November 17, 2026 23:51
@github-actions

Copy link
Copy Markdown
Contributor

🚀 This is included in version v1.28.1

This branch was successfully deployed

1 active deployment
Preview — 9a275156 Deployed Nov 17, 2026 by rchlfryn via build #3321
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