Skip to content

fix(permitato): Pi-hole status stays on 'Checking...' when backend returns non-OK #312

Description

@slomin

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

  1. Start Potato OS without a Pi-hole password file (/opt/potato/config/permitato_pihole_password)
  2. Navigate to the Permitato tab
  3. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions