Summary
When the Permitato status endpoint returns a non-OK HTTP response (e.g. 503 "Permitato not initialized"), the Pi-hole status indicator stays on "Checking..." forever instead of transitioning to "Disconnected".
Steps to reproduce
- Start Potato OS without a Pi-hole password file (
/opt/potato/config/permitato_pihole_password)
- Navigate to the Permitato tab
- Observe the Pi-hole status indicator in the status bar
Expected behavior
The status indicator should show "Disconnected" (red dot) when the backend can't connect to Pi-hole.
Actual behavior
The indicator stays on "Checking..." (the initial HTML text) indefinitely.
Root cause
In permitato.js:100, _pollStatus() does if (!resp.ok) return; — a 503 response is a successful fetch but not OK, so it early-returns without updating the status bar. The catch block only fires on network errors (fetch fails entirely). The status label never gets updated from its initial "Checking..." value.
Fix
Handle non-OK responses the same as network errors — call _updateStatusBar({ pihole_available: false, ... }) instead of silently returning.
Discovered during
Milestone closeout pass (#236), Phase 2 (local UI smoke test).
Refs #236
Summary
When the Permitato status endpoint returns a non-OK HTTP response (e.g. 503 "Permitato not initialized"), the Pi-hole status indicator stays on "Checking..." forever instead of transitioning to "Disconnected".
Steps to reproduce
/opt/potato/config/permitato_pihole_password)Expected behavior
The status indicator should show "Disconnected" (red dot) when the backend can't connect to Pi-hole.
Actual behavior
The indicator stays on "Checking..." (the initial HTML text) indefinitely.
Root cause
In
permitato.js:100,_pollStatus()doesif (!resp.ok) return;— a 503 response is a successful fetch but not OK, so it early-returns without updating the status bar. Thecatchblock only fires on network errors (fetch fails entirely). The status label never gets updated from its initial "Checking..." value.Fix
Handle non-OK responses the same as network errors — call
_updateStatusBar({ pihole_available: false, ... })instead of silently returning.Discovered during
Milestone closeout pass (#236), Phase 2 (local UI smoke test).
Refs #236