Skip to content

fix: explicit SKIPPED status for Tor/I2P/DNS sites when no proxy is configured#2815

Open
mvanhorn wants to merge 1 commit into
soxoj:mainfrom
mvanhorn:fix/2664-tor-i2p-checker-skip-status
Open

fix: explicit SKIPPED status for Tor/I2P/DNS sites when no proxy is configured#2815
mvanhorn wants to merge 1 commit into
soxoj:mainfrom
mvanhorn:fix/2664-tor-i2p-checker-skip-status

Conversation

@mvanhorn

Copy link
Copy Markdown

Summary

In the dispatch path (maigret/checking.py around line 852, right after checker = make_protocol_checker(options, site.protocol)), detect when the resolved checker is the no-op mock via isinstance(checker, CheckerMock) and short-circuit before the request is attempted. Instead of dispatching to the mock, build a MaigretCheckResult with MaigretCheckStatus.ILLEGAL plus an explanatory CheckError("Skipped", "no <protocol> gateway configured"), mirroring the existing disabled-site branch (checking.py ~860) that already renders cleanly in CLI and JSON. Reusing ILLEGAL keeps the change to a single file and avoids touching the report/rendering layer (no new enum value to plumb through maigret/report.py), while still satisfying the acceptance criteria: no "Connection lost" entries for .onion/.i2p/domain sites and a one-line skip explanation in the report.

Why this matters

When the user does not pass --tor-proxy / --i2p-proxy / --with-domains, the corresponding protocol checker is resolved to a CheckerMock (maigret/checking.py:599) whose check() returns ('', 0, None). A status_code of 0 is later interpreted as CheckError("Connection lost"), so every .onion / .i2p / domain entry reports a fake "Connection lost" error instead of being honestly skipped. This pollutes --print-errors, masks real connection-lost errors on clearweb sites, and is misleading because the site was never actually contacted. The issue was filed by the maintainer (soxoj) with detailed code refs and acceptance criteria; a contributor noted the exact symptom string has drifted, but the underlying CheckerMock mechanism is unchanged on current main (verified at checking.py:599-610 and the proxy-absent fallbacks at checking.py:1121-1138).

See #2664.

Testing

  • Happy path: clearweb site with a real checker still reaches the normal request path and reports CLAIMED/AVAILABLE unchanged. - Edge case: .onion site dispatched with no --tor-proxy yields a skipped result with an explanatory message, and --print-errors shows no "Connection lost" entry for it. - Edge case: .i2p and domain (DNS) sites behave identically when their proxy/option is absent. - Error path: a genuine clearweb connection failure still surfaces as a real CheckError("Connection lost") and is not swallowed by the new skip branch.

Fixes #2664

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.

Replace silent CheckerMock fallback for Tor/I2P/DNS with explicit skip status

1 participant