feat(oref): add OREF sirens panel with Hebrew-to-English translation#545
feat(oref): add OREF sirens panel with Hebrew-to-English translation#545
Conversation
Add real-time Israel Home Front Command (OREF) siren alerts panel: - Edge Function proxy at api/oref-alerts.js - OrefSirensPanel component with live/history views - oref-alerts service with 10s polling and update callbacks - Hebrew→English translation via existing translateText() LLM chain with 3-layer caching (in-memory Map → server Redis → circuit breaker) - i18n strings for all 23 locales - Panel registration, data-loader integration, CSS styles
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c99e45b946
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const result = execSync( | ||
| `curl -s -x "${proxyUrl}" --max-time 15 -H "Accept: application/json" -H "Referer: https://www.oref.org.il/" "${url}"`, | ||
| { encoding: 'utf8', timeout: 20000 } |
There was a problem hiding this comment.
Replace synchronous curl call in OREF poller
Using execSync here blocks the Node.js event loop for up to 20 seconds on every OREF poll attempt (--max-time 15 plus process overhead), so when OREF is enabled the relay can stop serving unrelated HTTP/WS traffic during each fetch window. This can cause visible freezes in AIS/other relay endpoints under normal operation, not just under failure conditions.
Useful? React with 👍 / 👎.
| // OREF (Israel Home Front Command) siren alerts — fetched via HTTP proxy (Israel exit) | ||
| const OREF_PROXY_AUTH = process.env.OREF_PROXY_AUTH || ''; // format: user:pass@host:port | ||
| const OREF_ALERTS_URL = 'https://www.oref.org.il/WarningMessages/alert/alerts.json'; | ||
| const OREF_POLL_INTERVAL_MS = Math.max(30_000, Number(process.env.OREF_POLL_INTERVAL_MS || 300_000)); |
There was a problem hiding this comment.
Lower default OREF source polling latency
The relay polls OREF every 5 minutes by default and enforces a minimum of 30 seconds, while the frontend poller runs every 10 seconds and the UI text describes near-real-time behavior. With this default, short-lived sirens can be missed or shown long after they trigger, so the feature is inaccurate out of the box unless operators explicitly override the env var.
Useful? React with 👍 / 👎.
| onOrefAlertsUpdate((update) => { | ||
| (this.ctx.panels['oref-sirens'] as OrefSirensPanel)?.setData(update); | ||
| }); |
There was a problem hiding this comment.
Avoid re-registering OREF update callbacks on each reload
This registration runs every time loadIntelligenceSignals() executes (including periodic refreshes), but the callback list is only cleared on app destroy. Over time this accumulates duplicate listeners, causing repeated setData calls per tick and unnecessary render/memory growth during long-running sessions.
Useful? React with 👍 / 👎.
Summary
api/oref-alerts.js) to relay OREF API datatitle,data[],desc) via existingtranslateText()LLM fallback chain (Ollama → Groq → OpenRouter → Browser T5)Test plan
npx tsc --noEmitpasses cleannode tests/oref-proxy.test.mjsfor Edge Function proxy tests