fix: clarify update network failures#1684
Conversation
ReviewReading the PR diff against Code I read
What I likeThe browser-string regex is the right shape — The interaction with One small nit (non-blocking)
function _isUpdateApplyNetworkError(error){
if(error && error.status) return false; // got an HTTP response
const message=(error&&error.message)||String(error||'');
return /Failed to fetch|NetworkError|Load failed/i.test(message);
}Optional — happy to merge as-is and revisit if it ever surfaces. Test coverageThe three new tests are source-level assertions, consistent with how the rest of the JS-touching tests in this repo are written ( Verification I didRead-only diff inspection only, per cron policy — I didn't run anything from the worktree. CI passing across 3.11/3.12/3.13 covers what I'd otherwise have run locally. LGTM. Will let nesquena take the merge call. |
|
Addressed the optional reviewer nit in d51510a. What changed:
Verification:
Cleanup: disposable worktree |
Follow-up review on
|
4daa238
|
Closed by the v0.51.4 release in PR #1707 (merged at 4daa238, deployed to production). Live on production: https://github.com/nesquena/hermes-webui/releases/tag/v0.51.4 🚀 |
10 PRs (3 surfaces additions, 7 fixes): - nesquena#1644 model picker chip + group count (@bergeouss, closes nesquena#1425) - nesquena#1684 update network failures UX (@Michaelyklam, closes nesquena#1321) - nesquena#1685 Codex spark models (@Michaelyklam, closes nesquena#1680) - nesquena#1689 normalize profile base homes (@Michaelyklam, refs nesquena#749) - nesquena#1693 adaptive title refresh deadlock (@ai-ag2026) - nesquena#1701 normalize update banner URL (@Michaelyklam, closes nesquena#1691) - nesquena#1702 workspace double-click rename (@Michaelyklam, closes nesquena#1698) - nesquena#1703 cache invalidation on auth-store drift (@Michaelyklam, closes nesquena#1699) - nesquena#1704 markdown fence lengths (@Michaelyklam, closes nesquena#1696) - nesquena#1706 multi-image paste fix (@Michaelyklam, closes nesquena#1697) Tests: 4477 → 4503 (+26). Opus: SHIP, 7/7 verification clean. Co-authored-by: Michael Lam <Michaelyklam1@gmail.com> Co-authored-by: ai-ag2026 <noreply@github.com> Co-authored-by: bergeouss <noreply@github.com>
Thinking Path
Issue #1321 was narrowed by maintainer comments to a frontend UX gap:
fetch('/api/updates/apply')can reject before any HTTP response arrives, so the browser's rawFailed to fetchtext leaked into the Update Now error UI. Server-reachable updater failures already return structured JSON and should keep the existing targeted message path.What Changed
Failed to fetch,NetworkError,Load failed)._showUpdateError(target, res)unchanged.Why It Matters
Users hitting a dying-process, stale-port, service-worker, or interrupted connection during self-update now get actionable recovery steps instead of the opaque browser string
Failed to fetch. The duplicate-submit guard also reduces the likely double-click race that can hit the server while it is already restarting.Evidence / UI Media
Mocked
TypeError: Failed to fetchfrom/api/updates/applyon an isolated local WebUI server:Verification
/home/michael/.hermes/hermes-agent/venv/bin/python -m pytest tests/test_update_apply_ui.py -qinitially failed on the missing friendly network-error formatter and in-flight guard.node --check static/ui.js/home/michael/.hermes/hermes-agent/venv/bin/python -m pytest tests/test_update_apply_ui.py tests/test_updates.py tests/test_version_badge.py tests/test_service_worker_api_cache.py tests/test_subpath_frontend_routes.py -q→45 passed in 1.89sgit diff --checkhttp://127.0.0.1:18791/?test_updates=1with synthetic mocked failures:TypeError: Failed to fetchshows the recovery-oriented message and does not show only rawFailed to fetch.{ok:false,message:'structured server failure'}still showsUpdate failed (webui): structured server failure.Risks / Follow-ups
Closes #1321
Model Used
AI-assisted with Hermes Agent using OpenAI Codex
gpt-5.5; tools used included terminal, file editing, browser validation, and GitHub CLI.