Public location page shows "Loading alerts…" forever — never fetches current alerts #49

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

public_location.html:30-38 relies solely on sse-swap="new_alert" deltas;
the route (app/api/locations.py:224-241) passes no alerts and the SSE
generator sends no backfill. Visitors during an active alert see the
"Loading alerts…" placeholder indefinitely; alerts active before page-open
never appear. Server-render the location's current active alerts (mirror the
dashboard query, filtered to this location, public-safe fields only), render
an explicit "No active alerts" empty state, and keep SSE for live updates.
While in the template: it also displays exact coordinates — handled separately
in the public-surface privacy issue (F-21).

Acceptance criteria:

  • Page load during an active alert lists it without waiting for SSE
  • Empty state says "No active alerts" (placeholder removed)
  • SSE continues to prepend live alerts without duplicating rendered ones

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

`public_location.html:30-38` relies solely on `sse-swap="new_alert"` deltas; the route (app/api/locations.py:224-241) passes no alerts and the SSE generator sends no backfill. Visitors during an active alert see the "Loading alerts…" placeholder indefinitely; alerts active before page-open never appear. Server-render the location's current active alerts (mirror the dashboard query, filtered to this location, public-safe fields only), render an explicit "No active alerts" empty state, and keep SSE for live updates. While in the template: it also displays exact coordinates — handled separately in the public-surface privacy issue (F-21). **Acceptance criteria:** - [ ] Page load during an active alert lists it without waiting for SSE - [ ] Empty state says "No active alerts" (placeholder removed) - [ ] SSE continues to prepend live alerts without duplicating rendered ones --- _Filed from the 2026-07-17 codebase audit (`docs/.internal/report-2026-07-17.md`), finding F-10._
Author
Contributor

Fixed in #92 (merged to main). The public location route now queries the location's current active alerts and the template server-renders them (matching the dashboard card shape) with an explicit "No active alerts" empty state instead of a perpetual "Loading alerts…". SSE live updates are retained and de-duped by data-alert-id so a live alert doesn't duplicate a server-rendered one. Tests cover the active-alert-on-load and empty-state cases.

Fixed in #92 (merged to `main`). The public location route now queries the location's current active alerts and the template server-renders them (matching the dashboard card shape) with an explicit "No active alerts" empty state instead of a perpetual "Loading alerts…". SSE live updates are retained and de-duped by `data-alert-id` so a live alert doesn't duplicate a server-rendered one. Tests cover the active-alert-on-load and empty-state cases.
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#49
No description provided.