Skip to content

Fix LostConnectionModal from appearing as a false positive for a timed out healthz request#1368

Merged
deep1401 merged 2 commits intomainfrom
fix/lost-connection-false-pos
Feb 19, 2026
Merged

Fix LostConnectionModal from appearing as a false positive for a timed out healthz request#1368
deep1401 merged 2 commits intomainfrom
fix/lost-connection-false-pos

Conversation

@deep1401
Copy link
Copy Markdown
Member

@deep1401 deep1401 commented Feb 19, 2026

Fixes #1367

Summary by CodeRabbit

  • Bug Fixes

    • Improved connection health monitoring to reduce false error notifications by requiring errors to persist for a short duration before being reported to users.
  • Refactor

    • Enhanced error detection logic for more stable and reliable connection status feedback.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 19, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

The useConnectionHealth hook now implements persisted-error detection, tracking when errors first appear and maintaining a ~10-second delay window before marking isError as true. Errors reset on connection changes or successful data receipt, while existing isLoading behavior remains unchanged.

Changes

Cohort / File(s) Summary
Persisted Error Detection
src/renderer/lib/api-client/hooks.ts
Modified useConnectionHealth hook to implement delayed error reporting with persistence window (~10 seconds), tracking error onset time and resetting on connection/data changes. Added React import and internal state management without altering public API signatures.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A hopping improvement so fine,
Errors now wait their ten-second time,
No false alarms to cause us strife,
Just steady connections for better life,
The hook bounces on, resilient and bright!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: implementing persisted-error detection in useConnectionHealth to prevent false positives from temporary healthz request timeouts.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/lost-connection-false-pos

Comment @coderabbitai help to get the list of available commands and usage tips.

@deep1401 deep1401 merged commit a84cf39 into main Feb 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When I submit a job I often get a "Connection Lost" overlay

2 participants