Skip to content

approval-ui: fix Grafana dashboard iframe error detection#23

Merged
maxmalkin merged 4 commits intomainfrom
dashboard-grafana-probe
Mar 4, 2026
Merged

approval-ui: fix Grafana dashboard iframe error detection#23
maxmalkin merged 4 commits intomainfrom
dashboard-grafana-probe

Conversation

@maxmalkin
Copy link
Owner

The Grafana dashboard page was showing the browser's native ERR_CONNECTION_REFUSED error inside the iframe instead of the custom "GRAFANA UNREACHABLE" error state. This is because onError on <iframe> elements only fires for HTTP-level errors, not network-level connection failures.

Changes

Grafana availability probe — on component mount, a no-cors fetch checks whether Grafana is reachable. If the connection is refused, iframeError is set immediately and the custom error card displays before the iframe ever renders.

Retry reprobe — the RETRY button now re-probes Grafana availability rather than blindly showing the iframe. It clears the error state (giving visual feedback), then probes again; if Grafana is still down, the error state returns.

Formatting — prettier and rustfmt reformatted approval-ui and audit-archiver/demo-agent files.

The iframe onError event doesn't fire for ERR_CONNECTION_REFUSED, so
probing Grafana availability on mount ensures the custom error state
displays when Grafana is unreachable. Also reformatted with prettier.
The RETRY button now clears the error state and probes Grafana again
instead of just showing the iframe without verification.
Minor formatting adjustments to audit-archiver and demo-agent
for improved readability.
GRANT SELECT/INSERT and REVOKE UPDATE/DELETE in partition.rs triggered
the check because the pattern matched any format! containing those
keywords. Narrow to DML-specific phrases (SELECT FROM, INSERT INTO,
UPDATE SET, DELETE FROM) so legitimate DDL with internally-generated
partition names is excluded.
@maxmalkin maxmalkin merged commit c9d60c2 into main Mar 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant