Skip to content

fix: clean setup probe timeout/error handling#33

Merged
lan17 merged 1 commit intomainfrom
lev/cleanup
Feb 26, 2026
Merged

fix: clean setup probe timeout/error handling#33
lan17 merged 1 commit intomainfrom
lev/cleanup

Conversation

@lan17
Copy link
Copy Markdown
Owner

@lan17 lan17 commented Feb 26, 2026

Summary

Tightens setup test-connection behavior and cleans up related test code.

What Changed

  • src/homesec/services/setup.py

    • Removed unused cause parameter/state from SetupTestConnectionRequestError.
    • Renamed ONVIF-specific timeout cap constant to be explicit:
      • _TEST_CONNECTION_TIMEOUT_CAP_S -> _ONVIF_TEST_CONNECTION_TIMEOUT_CAP_S.
    • Refined plugin probe timeout/error handling to distinguish phases:
      • plugin load timeout/failure
      • plugin ping timeout/failure
    • Updated logs and user-facing probe messages to reflect the exact failing phase.
  • tests/homesec/test_api_setup_routes.py

    • Cleaned import/type usage to avoid duplicate setup model import pattern and keep lint/format clean.

Why

  • Improves operator/debug experience by making timeout/failure messages actionable (load vs ping).
  • Removes dead/unused error constructor complexity.
  • Keeps naming aligned with actual scope (ONVIF-only cap).

Validation

  • make check
    • Python: ruff, ruff format --check, mypy --strict, pytest all pass.
    • UI: pnpm check passes.

Scope

  • No API contract changes.
  • No behavioral changes outside setup test-connection error/timeout reporting clarity.

@lan17 lan17 marked this pull request as ready for review February 26, 2026 17:18
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.85%. Comparing base (9b29b13) to head (11cbea0).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/homesec/services/setup.py 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #33      +/-   ##
==========================================
- Coverage   82.89%   82.85%   -0.05%     
==========================================
  Files         107      107              
  Lines        9652     9658       +6     
==========================================
+ Hits         8001     8002       +1     
- Misses       1651     1656       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lan17 lan17 merged commit 81631d6 into main Feb 26, 2026
3 of 5 checks passed
@lan17 lan17 deleted the lev/cleanup branch February 26, 2026 17:27
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