fix: less eager "Reconnecting..." modal#106
Merged
Merged
Conversation
The connection health check polled /api/agents — a real handler that queries the DB and Docker — with a 3s timeout. Under load (mid-stream agent response, Docker reconciliation) the request could miss the timeout even though the server was fine, flashing the modal. The modal also appeared on a single failed poll, so any one-off network hiccup would trigger it. The behavior was reported as common in Tauri's WebKitGTK webview and rare in desktop browsers, consistent with the webview being more aggressive about aborts and the bundled-frontend build sharing more runtime with the API handlers. Changes: - Poll /api/health instead — pure JSON response, no DB / Docker. - Raise timeout from 3s to 8s. - Require two consecutive failures before showing the modal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The "Reconnecting..." overlay was appearing too easily — particularly inside the Tauri desktop app, where users often see it briefly and then it disappears on its own.
Two reasons it false-fires:
/api/agents, which does real work (registry lookup + per-agent Dockerobserve_with(...)). Under load — mid-stream agent response, Docker reconciliation — that handler can miss its 3s timeout even though the server is fine.serverConnected = falseand pops the modal. Any one-off hiccup is enough.Tauri makes it worse because WebKitGTK seems to abort/time-out fetches more aggressively than desktop browsers, and the Tauri build serves the frontend through the same axum runtime that handles API requests.
Changes
/api/health(a stateless JSON response, no DB or Docker) instead of/api/agents.Auto-reload-on-recover behavior is unchanged.
Test plan
xpressclaw down) with the app open — modal should appear within ~10s./api/healthreturns 200.