[PR #2] [MERGED] fix(warnings): MeteoAlarm feed + rotator timer reset #1

Closed
opened 2026-08-09 19:09:24 +02:00 by zaph0d · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/niels-emmer/wall-cast/pull/2
Author: @niels-emmer
Created: 3/21/2026
Status: Merged
Merged: 3/21/2026
Merged by: @niels-emmer

Base: mainHead: fix/warnings-datasource-and-timer


📝 Commits (1)

  • a4938c4 fix(warnings): switch to MeteoAlarm feed + fix rotator timer reset

📊 Changes

4 files changed (+135 additions, -106 deletions)

View changed files

📝 backend/app/routers/warnings.py (+101 -82)
📝 docs/memory/INDEX.md (+3 -3)
📝 docs/memory/records/decision-log.md (+7 -3)
📝 frontend/src/widgets/rotate/RotatorWidget.tsx (+24 -18)

📄 Description

Summary

Two bugs introduced with the warnings widget, both fixed here.

  • Wrong data source: The KNMI CDN XML returns 403 to server-side HTTP requests (browser-only). Switched to feeds.meteoalarm.org/feeds/meteoalarm-legacy-atom-netherlands — the official public Atom/CAP 1.2 feed that KNMI feeds into. No API key needed. Parses cap:severity → geel/oranje/rood, cap:areaDesc → region, cap:event → phenomenon, filters to currently-active entries only.

  • Rotator timer reset: skipSet was in useState, so it appeared in the setInterval effect's dependency array. Each onSkip() call restarted the interval, giving the previous slot a fresh full rotation period (effectively 2× display time). Moved skipSet to useRef with a separate skipVersion counter for re-renders — interval now only recreates when slot count or interval changes.

Test plan

  • git pull && docker compose up --build -d on VPS
  • GET /api/warnings — should now return active fog warnings for NL (currently active per knmi.nl)
  • Warnings widget appears in rotator when data is present
  • With no warnings: widget skips cleanly without extending adjacent slot times

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/niels-emmer/wall-cast/pull/2 **Author:** [@niels-emmer](https://github.com/niels-emmer) **Created:** 3/21/2026 **Status:** ✅ Merged **Merged:** 3/21/2026 **Merged by:** [@niels-emmer](https://github.com/niels-emmer) **Base:** `main` ← **Head:** `fix/warnings-datasource-and-timer` --- ### 📝 Commits (1) - [`a4938c4`](https://github.com/niels-emmer/wall-cast/commit/a4938c4862f098f40c81716686f27401838a90f4) fix(warnings): switch to MeteoAlarm feed + fix rotator timer reset ### 📊 Changes **4 files changed** (+135 additions, -106 deletions) <details> <summary>View changed files</summary> 📝 `backend/app/routers/warnings.py` (+101 -82) 📝 `docs/memory/INDEX.md` (+3 -3) 📝 `docs/memory/records/decision-log.md` (+7 -3) 📝 `frontend/src/widgets/rotate/RotatorWidget.tsx` (+24 -18) </details> ### 📄 Description ## Summary Two bugs introduced with the warnings widget, both fixed here. - **Wrong data source**: The KNMI CDN XML returns 403 to server-side HTTP requests (browser-only). Switched to `feeds.meteoalarm.org/feeds/meteoalarm-legacy-atom-netherlands` — the official public Atom/CAP 1.2 feed that KNMI feeds into. No API key needed. Parses `cap:severity` → geel/oranje/rood, `cap:areaDesc` → region, `cap:event` → phenomenon, filters to currently-active entries only. - **Rotator timer reset**: `skipSet` was in `useState`, so it appeared in the `setInterval` effect's dependency array. Each `onSkip()` call restarted the interval, giving the previous slot a fresh full rotation period (effectively 2× display time). Moved `skipSet` to `useRef` with a separate `skipVersion` counter for re-renders — interval now only recreates when slot count or interval changes. ## Test plan - [ ] `git pull && docker compose up --build -d` on VPS - [ ] `GET /api/warnings` — should now return active fog warnings for NL (currently active per knmi.nl) - [ ] Warnings widget appears in rotator when data is present - [ ] With no warnings: widget skips cleanly without extending adjacent slot times 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
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
github-mirrors/wall-cast#1
No description provided.